Debian Codegraph @

testsuite/modules.50-cmds/175-swap2.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.50-cmds/%M%
6 # First Edition: 2008/02/19
7 #
8 # Authors: R.K. Owen, <[email protected]>
9 #
10 # Description: Testuite testsequence
11 # Command: swap
12 #
13 # Comment: %C{
14 # Tests the 'swap' module subcommand where there are
15 # double prepends or appends.
16 # }C%
17 #
18 ##############################################################################
19
20 skip_if_quick_mode
21
22 set path21 "/modules/testsuite2.1"
23 set path2121 "/modules/testsuite2.1/2.1"
24 set path22 "/modules/testsuite2.2"
25 set path2222 "/modules/testsuite2.2/2.2"
26 set pathpre "/test/pre"
27 set pathpost "/test/post"
28
29 #
30 # Prepend test
31 #
32 set mod21 "prepend/2.1"
33 set mod22 "prepend/2.2"
34
35 set mod21p "$modpath/$mod21"
36 set mod22p "$modpath/$mod22"
37
38 set module "$mod21"
39 set modulefile "$mod21p"
40
41 #
42 # set up the environment
43 #
44
45 setenv_loaded_module $module $modulefile
46 set old_path $env(PATH)
47 set env(PATH) "$pathpre:$path21:$path2121:$pathpost"
48
49 #
50 # For the different shells ...
51 #
52
53 set module "$mod22"
54 set modulefile "$mod22p"
55
56 # different behavior than C-version: on Tcl-version loaded PATH is not
57 # prepended or appended only within the space occupied by the unloaded
58 # module but through the whole space of the variable. So prepended stuff
59 # will go at the beginning of the variable and appended stuff will go
60 # at the end.
61 lappend ans [list set PATH "$path22:$path2222:$pathpre:$pathpost"]
62 lappend ans [list set _LMFILES_ $modulefile]
63 lappend ans [list set LOADEDMODULES $module]
64
65 #
66 # The tests
67 #
68
69 test_cmd_re "ALL" "swap $mod21 $mod22" $ans
70
71 #
72 # Append test
73 #
74 set mod21 "append/2.1"
75 set mod22 "append/2.2"
76
77 set mod21p "$modpath/$mod21"
78 set mod22p "$modpath/$mod22"
79
80 set module "$mod21"
81 set modulefile "$mod21p"
82
83 #
84 # set up the environment
85 #
86
87 setenv_loaded_module $module $modulefile
88 set env(PATH) "$pathpre:$path21:$path2121:$pathpost"
89
90 #
91 # For the different shells ...
92 #
93
94 set module "$mod22"
95 set modulefile "$mod22p"
96
97 # different behavior than C-version: same remark than above
98 set ans [list]
99 lappend ans [list set PATH "$pathpre:$pathpost:$path22:$path2222"]
100 lappend ans [list set _LMFILES_ $modulefile]
101 lappend ans [list set LOADEDMODULES $module]
102
103 #
104 # The tests
105 #
106
107 test_cmd_re "ALL" "swap $mod21 $mod22" $ans
108
109 #
110 # clean up
111 #
112
113 reset_test_env