Debian Codegraph @

testsuite/modules.50-cmds/280-info-specified.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: 2017/01/22
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: load, display, help, switch, unload, test
14 # Modulefiles: info/specified
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Tests the 'module-info specified' module subcommand
19 # }C%
20 #
21 ##############################################################################
22
23 #
24 # Variables. This test forces a module load command. It will result in the
25 # environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
26 # be set up
27 #
28
29 set module "info/specified"
30 set module2 "info/foo"
31 set modulefile "$modpath/$module"
32 set modulefilere "$modpathre/$module"
33
34 #
35 # For sh shell only (no need to check every shells)
36 #
37
38 lappend ans [list set __MODULES_LMALTNAME "$module&$module2"]
39 lappend ans [list set _LMFILES_ $modulefile]
40 lappend ans [list set LOADEDMODULES $module]
41
42 #
43 # The tests
44 #
45
46 # test loading
47 testouterr_cmd "sh" "load $module" $ans "$module"
48 testouterr_cmd "sh" "load $module2" $ans "$module2"
49
50 skip_if_quick_mode
51
52 # test displaying
53 testouterr_cmd_re "sh" "display $module" "OK" "$modlin\n$modulefilere:\n\n$module\n$modlin"
54 testouterr_cmd_re "sh" "display $module2" "OK" "$modlin\n$modulefilere:\n\n$module2\n$modlin"
55
56 # test help
57 testouterr_cmd_re "sh" "help $module" "OK" "$modlin\nModule Specific Help for $modulefilere:\n\n$module\n$modlin"
58 testouterr_cmd_re "sh" "help $module2" "OK" "$modlin\nModule Specific Help for $modulefilere:\n\n$module2\n$modlin"
59
60 # test test
61 testouterr_cmd_re "sh" "test $module" "OK" "$modlin\nModule Specific Test for $modulefilere:\n\n$module\nTest result: PASS\n$modlin"
62 testouterr_cmd_re "sh" "test $module2" "OK" "$modlin\nModule Specific Test for $modulefilere:\n\n$module2\nTest result: PASS\n$modlin"
63
64 # Set up the environment for test that require the module to be loaded
65 setenv_loaded_module $module $modulefile
66 setenv_var __MODULES_LMALTNAME "$module&$module2"
67
68 # test switching
69 testouterr_cmd "sh" "switch $module $module" $ans "$module\n$module"
70 testouterr_cmd "sh" "switch $module $module2" $ans "$module\n$module2"
71 testouterr_cmd "sh" "switch $module2 $module" $ans "$module2\n$module"
72
73 # test unloading
74 set ans [list]
75 lappend ans [list unset __MODULES_LMALTNAME]
76 lappend ans [list unset _LMFILES_]
77 lappend ans [list unset LOADEDMODULES]
78
79 testouterr_cmd "sh" "unload $module" $ans "$module"
80 testouterr_cmd "sh" "unload $module2" $ans "$module2"
81
82
83 #
84 # Cleanup
85 #
86
87 reset_test_env