Debian Codegraph @

testsuite/modules.70-maint/410-timer.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.70-maint/%M%
6 # Revision: %I%
7 # First Edition: 2022/05/26
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: list, avail
14 # Modulefiles: foo, bar
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Test --timer command line switch
19 # }C%
20 #
21 ##############################################################################
22
23 set mp $modpath.3
24 set mpre $modpathre.3
25 setenv_path_var MODULEPATH $mp
26
27 set total_timer "$timer_msgs Total execution took \\d+.\\d+ ms"
28
29
30 set tserr $no_loaded\n\n$total_timer
31 testouterr_cmd_re sh {--timer list} OK $tserr
32
33 skip_if_quick_mode
34
35 # ml
36 testouterr_cmd_re sh {ml --timer} OK $tserr
37
38 # load test
39 set tserr $total_timer
40 set ans [list]
41 lappend ans [list set _LMFILES_ $mp/foo/1.0]
42 lappend ans [list set LOADEDMODULES foo/1.0]
43 testouterr_cmd_re sh {load --timer foo/1.0} $ans $tserr
44
45 testouterr_cmd_re sh {--timer load} OK $tserr
46
47 # avail
48 set tserr ".*\n\n$total_timer"
49 testouterr_cmd_re sh {--timer avail} OK $tserr
50
51
52 # global initial error
53 set tserr "$error_msgs: Unknown shell type '\\\(unk\\\)'\n\n$total_timer"
54 # return OK instead shell error code, as we do not know what kind of shell code to output
55 testouterr_cmd_re unk {--timer avail} OK $tserr
56
57 # global error
58 set tserr "[err_invcmd foo]\n\n$total_timer"
59 testouterr_cmd_re sh {--timer foo} ERR $tserr
60
61
62 # json output (incompatible with timer reports)
63 set tserr \{$total_timer\n\}
64 testouterr_cmd_re sh {list --json --timer} OK $tserr
65
66 # verbose mode
67 set tserr [msg_load foo/1.0]\n\n$total_timer
68 testouterr_cmd_re sh {load foo/1.0 --verbose --timer} $ans $tserr
69
70 # silent mode
71 set tserr $total_timer
72 testouterr_cmd_re sh {--timer --silent load foo/1.0} $ans $tserr
73
74 set tserr $no_loaded\n\n$total_timer
75 testouterr_cmd_re sh {list --timer --silent} OK $tserr
76
77 # debug
78 set tserr "($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
79
80 [escre [msg_load foo/1.0 "Evaluate modulefile: '$mp/foo/1.0' as 'foo/1.0'"]]
81
82 ($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
83
84 $total_timer"
85 testouterr_cmd_re sh {load foo/1.0 --debug --timer} $ans $tserr
86 testouterr_cmd_re sh {load foo/1.0 --debug --timer --debug} $ans $tserr
87
88 set tserr "($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
89 $no_loaded
90 ($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
91
92 $total_timer"
93 testouterr_cmd_re sh {--timer list -D} OK $tserr
94 testouterr_cmd_re sh {--timer list -DD} OK $tserr
95
96
97 #
98 # Cleanup
99 #
100
101 reset_test_env