Debian Codegraph @

testsuite/modules.00-init/006-procs.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.00-init/%M%
6 # Revision: %I%
7 # First Edition: 95/12/06
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Jens Hamisch, [email protected]
11 #
12 # Description: Test procedures
13 # Command:
14 # Sub-Command:
15 #
16 # Comment: %C{
17 # Defines the testprocedures for probing the outputs
18 # on stdout and stderr of the test target
19 # }C%
20 #
21 ##############################################################################
22
23 #
24 # Test subprocedures
25 #
26
27 proc _test_sub {test_shell cmd {input noinput} {launcher {}}} {
28 global comp_output
29 global comp_error
30 global comp_exit
31 global shell
32 global verbose
33
34 if {$verbose} {
35 set cmdreport "modulecmd $test_shell $cmd"
36 if {$input ne {noinput}} {
37 append cmdreport " << $input"
38 }
39 send_user " ... Testing '$cmdreport'\n"
40 }
41 set comp_output ""
42 set comp_error ""
43 set comp_exit ""
44
45 if { ![info exists test_shell] || ![info exists cmd] } {
46 unresolved "$cmd ($test_shell) internal error"
47 }
48
49 set shell $test_shell
50 modulecmd_xxx_ "$cmd" $input $launcher
51
52 if { $verbose > 1 } {
53 set ol [string length $comp_output]
54 set oe [string length $comp_error]
55 send_user "OUT\[$ol\]: '$comp_output'#>\n"
56 send_user "ERR\[$oe\]: '$comp_error'#>\n"
57 send_user "EXIT: '$comp_exit'#>\n"
58 }
59 }