Debian Codegraph @

testsuite/install.00-init/025-autoinit.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: 2017/05/19
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command:
14 # Sub-Command:
15 #
16 # Comment: %C{
17 # Check basic set of module commands on all shells
18 # when module is initialized via 'autoinit' sub-command
19 # }C%
20 #
21 ##############################################################################
22
23
24 set bad_cmd "$error_msgs: Invalid command 'foo'"
25
26 #
27 # The tests
28 #
29
30 if {$verbose} {
31 send_user "\tChecking basic set of module commands\n"
32 }
33
34 foreach shell $shell_list {
35 testall_cmd_re "autoinit:$shell" "module --version" {} "Modules Release \\S+ (\\S+)" 0
36 testall_cmd "autoinit:$shell" "module foo" "" "$bad_cmd\n$type_help" 1
37 testall_cmd "autoinit:$shell" "module use $share_modpath\; module purge\; module load null\; module list -t" "" "$cur_loaded\nnull" 0
38 testall_cmd "autoinit:$shell" "module use $share_modpath\; module purge\; module load null\; module unload null\; module list -t" "" "$no_loaded" 0
39 }
40
41 if {$install_ml eq {y}} {
42 foreach shell $shell_list {
43 testall_cmd_re "autoinit:$shell" "ml --version" {} "Modules Release \\S+ (\\S+)" 0
44 testall_cmd "autoinit:$shell" "ml foo" "" "$error_msgs: Unable to locate a modulefile for 'foo'" 1
45 testall_cmd "autoinit:$shell" "ml use $share_modpath\; ml purge\; ml null\; ml list -t" "" "$cur_loaded\nnull" 0
46 testall_cmd "autoinit:$shell" "ml use $share_modpath\; ml purge\; ml null\; ml -null\; ml" "" "$no_loaded" 0
47 }
48 }
49
50
51 # test loaded module refresh performed during autoinit
52 setenv_path_var MODULEPATH $testsuite_modpath.3
53 setenv_loaded_module [list refresh/4.0] [list $testsuite_modpath.3/refresh/4.0]
54 setenv_var __MODULES_LMREFRESH refresh/4.0
55
56 foreach shell $shell_list {
57 if {$shell in {csh tcsh}} {
58 testall_cmd "autoinit:$shell" "alfoo" "foo4" "" 0
59 } else {
60 testall_cmd "autoinit:$shell" "alfoo; funcfoo" "foo4\nfoo4" "" 0
61 }
62 }
63
64
65 #
66 # Clean up variables used in this test case
67 #
68
69 reset_test_env
70
71 # vim:set tabstop=3 shiftwidth=3 expandtab autoindent: