Debian Codegraph @

testsuite/modules.50-cmds/088-info-isloaded.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.50-cmds/%M%
6 # Revision: %I%
7 # First Edition: 2001/07/25
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: R.K. Owen, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: load
14 # Modulefiles: info/isloaded
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Tests the 'is-loaded name' module subcommand for all
19 # allowed shell types.
20 # }C%
21 #
22 ##############################################################################
23
24 #
25 # Variables. This test forces a module load command. It will result in the
26 # environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
27 # be set up
28 #
29
30 set module "info/name"
31 set modulefile "$modpath/$module"
32 set modulex "info/isloaded"
33 set modulefilex "$modpath/$modulex"
34 set modules "$module:$modulex"
35 set modulefiles "$modulefile:$modulefilex"
36
37 #
38 # Test the case when the given module is loaded
39 #
40
41 #
42 # set up the environment
43 #
44 setenv_loaded_module $module $modulefile
45
46 #
47 # For the different shells ...
48 #
49
50 lappend ans [list set testsuite6 0]
51 lappend ans [list set testsuite2 0]
52 lappend ans [list set testsuite7 1]
53 lappend ans [list set testsuite3 1]
54 lappend ans [list set _LMFILES_ $modulefiles]
55 lappend ans [list set LOADEDMODULES $modules]
56 lappend ans [list set testsuite8 1]
57 lappend ans [list set testsuite4 1]
58 lappend ans [list set testsuite5 0]
59 lappend ans [list set testsuite1 1]
60
61 #
62 # The tests
63 #
64
65 testouterr_cmd_re "ALL" "load $modulex" $ans ""
66
67 skip_if_quick_mode
68
69 #
70 # Test the case when the given module is not loaded
71 #
72
73 #
74 # set up the environment
75 #
76 unsetenv_loaded_module
77
78 #
79 # For the different shells ...
80 #
81
82 set ans [list]
83 lappend ans [list set testsuite6 0]
84 lappend ans [list set testsuite2 0]
85 lappend ans [list set testsuite7 0]
86 lappend ans [list set testsuite3 0]
87 lappend ans [list set _LMFILES_ $modulefilex]
88 lappend ans [list set LOADEDMODULES $modulex]
89 lappend ans [list set testsuite8 0]
90 lappend ans [list set testsuite4 0]
91 lappend ans [list set testsuite5 0]
92 lappend ans [list set testsuite1 0]
93
94 #
95 # The tests
96 #
97
98 testouterr_cmd "ALL" "load $modulex" $ans ""
99
100 #
101 # Cleanup
102 #
103
104 reset_test_env