mirror of
https://github.com/envmodules/modules.git
synced 2026-06-14 00:42:43 +08:00
ts: consolidate output of multi pattern whatis search
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This commit is contained in:
@@ -690,7 +690,7 @@ lappend ans { "reportModules $args $modpath_label mp $hstyle $show_mtime 0 $one
|
||||
lappend ans { (procedure "cmdModuleAvail" line 44)}
|
||||
lappend ans { invoked from within}
|
||||
lappend ans { "$cmdprocname {*}$cmdopts {*}$parsed_args"}
|
||||
lappend ans { (procedure "module" line 189)}
|
||||
lappend ans { (procedure "module" line 190)}
|
||||
lappend ans { invoked from within}
|
||||
lappend ans { "{*}$execcmdlist"}
|
||||
testouterr_cmd sh {avail} ERR [join $ans \n]
|
||||
|
||||
@@ -390,6 +390,7 @@ colorset_test_case {avail loc_tr} [list hi loc_tr] ".*loc_tr.*loc_tr.*loc_tr.*lo
|
||||
colorset_test_case {avail loc_tr/3 loc_tr/1} [list hi loc_tr/1 hi loc_tr/3] ".*loc_tr/1.0.*loc_tr/3.0.*"
|
||||
colorset_test_case {spider loc_tr/3.0 loc_tr/1} [list hi loc_tr/1 hi loc_tr/3.0] ".*loc_tr/1.0.*loc_tr/3.0.*"
|
||||
colorset_test_case {whatis loc_tr} [list hi loc_tr] ".*\\s+loc_tr/1.0: .*\\s+loc_tr/2.0: .*\\s+loc_tr/3.0: .*"
|
||||
colorset_test_case {whatis loc_tr/2.0 loc_tr/1.0} [list hi loc_tr/1.0 hi loc_tr/2.0] ".*\\s+loc_tr/1.0: .*\\s+loc_tr/2.0: .*"
|
||||
colorset_test_case {search loc_tr} [list hi loc_tr] ".*: loc_tr/1.0\n.*: loc_tr/2.0\n.*: loc_tr/3.0"
|
||||
# matched strings expressed with the advanced version specifiers
|
||||
setenv_var MODULES_ADVANCED_VERSION_SPEC 1
|
||||
|
||||
@@ -87,6 +87,17 @@ setenv_path_var MODULEPATH $modpath
|
||||
#
|
||||
testouterr_cmd "csh" "whatis $module_6" "ERR" "$ts_csh_6"
|
||||
|
||||
# first pattern does not match
|
||||
testouterr_cmd_re sh "whatis $module_6 $module_2" OK $ts_csh_2
|
||||
|
||||
# second pattern does not match
|
||||
testouterr_cmd_re sh "whatis $module_2 $module_6" OK $ts_csh_2
|
||||
|
||||
# no pattern match
|
||||
testouterr_cmd_re sh "whatis $module_6 unk" ERR $err_path'unk'\n$ts_csh_6
|
||||
|
||||
# one module unknown and one found but without whatis information
|
||||
testouterr_cmd_re sh "whatis $module_6 $module_1" OK {}
|
||||
|
||||
#
|
||||
# test with erroneous modulefile
|
||||
|
||||
@@ -79,7 +79,7 @@ set test_post "$modlin"
|
||||
set disp_pre "$modlin"
|
||||
set disp_wi "module-whatis\\s+"
|
||||
set disp_post "$modlin"
|
||||
set whatis_pre "$modlin $modpathre $modlin\n"
|
||||
set whatis_pre "$modlin $modpathre $modlin"
|
||||
|
||||
|
||||
#
|
||||
@@ -145,11 +145,7 @@ proc multi_test_case {args} {
|
||||
if {[info exists "::whatis_${m}"]} {
|
||||
set modwhatis [set "::whatis_${m}"]
|
||||
append disp "$::disp_wi{$modwhatis}\n"
|
||||
|
||||
if {[info exists whatis]} {
|
||||
append whatis "\n\n"
|
||||
}
|
||||
append whatis "$::whatis_pre\\s+$mod: $modwhatis"
|
||||
set whatis_mod($mod) $modwhatis
|
||||
|
||||
}
|
||||
if {[info exists "::errdi_${m}"]} {
|
||||
@@ -166,6 +162,12 @@ proc multi_test_case {args} {
|
||||
append test "$::test_post"
|
||||
|
||||
}
|
||||
set whatis $::whatis_pre
|
||||
foreach mod [lsort $modsym] {
|
||||
if {[info exists whatis_mod($mod)]} {
|
||||
append whatis "\n\\s+$mod: $whatis_mod($mod)"
|
||||
}
|
||||
}
|
||||
|
||||
# setup clean environment
|
||||
unsetenv_loaded_module
|
||||
|
||||
@@ -134,7 +134,7 @@ unsetenv_var TESTSUITE_VARIANT
|
||||
# when advanced_version_spec is disabled, variant spec are considered as modulefile spec
|
||||
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
|
||||
setenv_var TESTSUITE_VARIANT 1
|
||||
set tserr "$modlin $mpre $modlin\n\\s+variant/6.0: variant/6.0\n\n$modlin $mpre $modlin\n\\s+var=val: var=val"
|
||||
set tserr "$modlin $mpre $modlin\n\\s+var=val: var=val\n\\s+variant/6.0: variant/6.0"
|
||||
testouterr_cmd_re sh {whatis variant/6.0 var=val} OK $tserr
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user