siteconfig.tcl-1 (modules-5.1.1.tar.bz2) | : | siteconfig.tcl-1 (modules-5.2.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
} | } | |||
# generate error with parseAccessIssue generic msg if following environment vari able is set | # generate error with parseAccessIssue generic msg if following environment vari able is set | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_ACCESSERR)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_ACCESSERR)]} { | |||
set errorCode "Custom error code" | set errorCode "Custom error code" | |||
error [parseAccessIssue "foo"] | error [parseAccessIssue "foo"] | |||
} | } | |||
# try element list display in terse+numbered mode if following environment varia ble is set | # try element list display in terse+numbered mode if following environment varia ble is set | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TERSENUM)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TERSENUM)]} { | |||
displayElementList test {} terse 1 1 [list elt1 elt2 elt3] | displayElementList test {} terse 1 1 1 [list elt1 elt2 elt3] | |||
} | } | |||
# try element list display with a tricky list that triggers unusual condition in displayElementList proc | # try element list display with a tricky list that triggers unusual condition in displayElementList proc | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TRICKYLISTDISP)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TRICKYLISTDISP)]} { | |||
# set a specific terminal column number to fall in tricky condition | # set a specific terminal column number to fall in tricky condition | |||
set orig_term_columns [getState term_columns] | set orig_term_columns [getState term_columns] | |||
setState term_columns 80 | setState term_columns 80 | |||
set max_len 0 | set max_len 0 | |||
foreach elt [list abc/def abcdefgh/ijklmnop abc/defg abcd/ef abc/defg-hijkl.m n.op abcdefgh/ijklm.nopqrst abcdefg/hijklmnop-qr.st.uvw abcdefgh/ijklmnopqrst-u- vwxy.zA-BCD-E abcdef/ghijklm-nopq.r_st.uv abcdefgh/ijklmnop-q-rstu.vw-xyz-A abcd efg/hijklmn-op.qr.stu abcdefg/hijkl-mn.op.qrs abcd/efgh-ij.k abcdefg/hijk-lmnop_ qr.st.uvw abcdef/ghijklmno-p.q.r abcdefgh/ijklmn-o-pqrs.tu abcdefgh/ijklmnop-q-r stu.vw-xyz abcdefg/hij-klm.nopq abcdefg/hij-kl.mn.opq abcdefgh/ijklmnopq_rstuv-w -xyzA.BC-DEF abcdefgh/ijklmnopqrstuv-w-xyzA.BC abcdefgh/ij-k-lmno.pq abcdefgh/ij k-l-mnop.qr-stu abcdefgh/ijklmnop-qr.st abcdef/ghijklmno-pq.rs abcdef/ghi-jklm_n o_pqrstuv abcdefgh/ijk-lm-n-opqr.st abcdefgh/ijklm-n-opqr.st-uvw abcdef/ghijklm- nopq_r abcdefg/hijkl-mn.op.qzs abcdefg/hijklmn-op.qr.stz abcdefgh/ijklmn] { | foreach elt [list abc/def abcdefgh/ijklmnop abc/defg abcd/ef abc/defg-hijkl.m n.op abcdefgh/ijklm.nopqrst abcdefg/hijklmnop-qr.st.uvw abcdefgh/ijklmnopqrst-u- vwxy.zA-BCD-E abcdef/ghijklm-nopq.r_st.uv abcdefgh/ijklmnop-q-rstu.vw-xyz-A abcd efg/hijklmn-op.qr.stu abcdefg/hijkl-mn.op.qrs abcd/efgh-ij.k abcdefg/hijk-lmnop_ qr.st.uvw abcdef/ghijklmno-p.q.r abcdefgh/ijklmn-o-pqrs.tu abcdefgh/ijklmnop-q-r stu.vw-xyz abcdefg/hij-klm.nopq abcdefg/hij-kl.mn.opq abcdefgh/ijklmnopq_rstuv-w -xyzA.BC-DEF abcdefgh/ijklmnopqrstuv-w-xyzA.BC abcdefgh/ij-k-lmno.pq abcdefgh/ij k-l-mnop.qr-stu abcdefgh/ijklmnop-qr.st abcdef/ghijklmno-pq.rs abcdef/ghi-jklm_n o_pqrstuv abcdefgh/ijk-lm-n-opqr.st abcdefgh/ijklm-n-opqr.st-uvw abcdef/ghijklm- nopq_r abcdefg/hijkl-mn.op.qzs abcdefg/hijklmn-op.qr.stz abcdefgh/ijklmn] { | |||
lappend display_list $elt | lappend display_list $elt | |||
lappend len_list [string length $elt] | lappend len_list [string length $elt] | |||
if {[string length $elt] > $max_len} { | if {[string length $elt] > $max_len} { | |||
set max_len [string length $elt] | set max_len [string length $elt] | |||
} | } | |||
} | } | |||
displayElementList test {} terse 0 1 $display_list $len_list $max_len | displayElementList test {} terse 0 1 1 $display_list $len_list $max_len | |||
setState term_columns $orig_term_columns | setState term_columns $orig_term_columns | |||
} | } | |||
# try reading file content without error message on failure if following environ ment variable is set | # try reading file content without error message on failure if following environ ment variable is set | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_READMODNOREPORT)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_READMODNOREPORT)]} { | |||
readModuleContent "/path/to/unexistent/file" | readModuleContent "/path/to/unexistent/file" | |||
} | } | |||
# use loaded module accessor on non-loaded module if following environment varia ble is set | # use loaded module accessor on non-loaded module if following environment varia ble is set | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR)]} { | |||
skipping to change at line 97 | skipping to change at line 97 | |||
# fake Windows platform if following environment variable is set | # fake Windows platform if following environment variable is set | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM)]} { | |||
set tcl_platform(platform) "windows" | set tcl_platform(platform) "windows" | |||
} | } | |||
# test getDiffBetweenList procedure with element of second list arg not in first list arg | # test getDiffBetweenList procedure with element of second list arg not in first list arg | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENLIST)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENLIST)]} { | |||
report [getDiffBetweenList [list same foo foo2] [list same bar bar2]] | report [getDiffBetweenList [list same foo foo2] [list same bar bar2]] | |||
} | } | |||
# test getDiffBetweenArray procedure with element of first list arg with empty v | ||||
alue | ||||
# not in second list arg (notset_equals_empty option enabled) | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENARRAY)]} { | ||||
array set arr1 [list same {} foo val] | ||||
array set arr2 [list foo val] | ||||
report [getDiffBetweenArray arr1 arr2 1] | ||||
} | ||||
# test twice calls to getConf term_background and getConf colors procedures | # test twice calls to getConf term_background and getConf colors procedures | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TWICEINITCOLORS)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_TWICEINITCOLORS)]} { | |||
getConf term_background | getConf term_background | |||
getConf term_background | getConf term_background | |||
getConf colors | getConf colors | |||
getConf colors | getConf colors | |||
} | } | |||
# test clear sub-command confirmation message without waiting indefinitely | # test clear sub-command confirmation message without waiting indefinitely | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXITONGETSSTDIN)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXITONGETSSTDIN)]} { | |||
skipping to change at line 446 | skipping to change at line 454 | |||
proc execShAndGetEnv [info args execShAndGetEnv] "$tracevarcall ; [info body execShAndGetEnv]" | proc execShAndGetEnv [info args execShAndGetEnv] "$tracevarcall ; [info body execShAndGetEnv]" | |||
} | } | |||
# supersede pwd procedure to raise an error | # supersede pwd procedure to raise an error | |||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_PWDERROR)]} { | if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_PWDERROR)]} { | |||
proc pwd {} { | proc pwd {} { | |||
error {Custom error message} | error {Custom error message} | |||
} | } | |||
} | } | |||
# extra modulefile/modulerc command and variable tests | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_ODD)]} { | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_ODD) { | ||||
cmd {set modulefile_extra_cmds [list mycmd]} | ||||
rc_cmd {set modulerc_extra_cmds [list mycmd]} | ||||
var {set modulefile_extra_vars [list myvar]} | ||||
rc_var {set modulerc_extra_vars [list myvar]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_EMPTYDEF)]} { | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_EMPTYDEF) { | ||||
cmd {set modulefile_extra_cmds [list]} | ||||
rc_cmd {set modulerc_extra_cmds {}} | ||||
var {set modulefile_extra_vars {}} | ||||
rc_var {set modulerc_extra_vars [list]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_EMPTYVAL)]} { | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_EMPTYVAL) { | ||||
cmd {set modulefile_extra_cmds [list mycmd {}]} | ||||
rc_cmd {set modulerc_extra_cmds [list mycmd {}]} | ||||
var {set modulefile_extra_vars [list myvar {}]} | ||||
rc_var {set modulerc_extra_vars [list myvar {}]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_UNK)]} { | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_UNK) { | ||||
cmd {set modulefile_extra_cmds [list mycmd unkproc]} | ||||
rc_cmd {set modulerc_extra_cmds [list mycmd unkproc]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SUPERSEDE)]} { | ||||
proc myproc1 {args} { | ||||
return myproc1 | ||||
} | ||||
proc myproc2 {args} { | ||||
return myproc2 | ||||
} | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SUPERSEDE) { | ||||
cmd {set modulefile_extra_cmds [list uname myproc1 pid myproc2]} | ||||
rc_cmd {set modulerc_extra_cmds [list uname myproc1 pid myproc2]} | ||||
var {set modulefile_extra_vars [list ModuleTool super ModulesCurrentM | ||||
odulefile myfile]} | ||||
rc_var {set modulerc_extra_vars [list ModuleTool super ModulesCurrentMod | ||||
ulefile myfile]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SPACEINVAL)]} { | ||||
proc {my proc1} {args} { | ||||
return myproc1 | ||||
} | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SPACEINVAL) { | ||||
cmd {set modulefile_extra_cmds [list mycmd {my proc1}]} | ||||
rc_cmd {set modulerc_extra_cmds [list mycmd {my proc1}]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SPACEINNAME)]} { | ||||
proc myproc1 {args} { | ||||
return myproc1 | ||||
} | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_SPACEINNAME) { | ||||
cmd {set modulefile_extra_cmds [list {my cmd} myproc1]} | ||||
rc_cmd {set modulerc_extra_cmds [list {my cmd} myproc1]} | ||||
var {set modulefile_extra_vars [list {my var} value]} | ||||
rc_var {set modulerc_extra_vars [list {my var} value]} | ||||
} | ||||
} | ||||
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_REGULAR)]} { | ||||
proc mycmd {args} { | ||||
return myproc1 | ||||
} | ||||
proc mycmd2 {args} { | ||||
return myproc2 | ||||
} | ||||
switch -- $env(TESTSUITE_ENABLE_SITECONFIG_EXTRA_REGULAR) { | ||||
cmd {set modulefile_extra_cmds [list mycmd mycmd othercmd mycmd2]} | ||||
rc_cmd {set modulerc_extra_cmds [list mycmd mycmd othercmd mycmd2]} | ||||
var {set modulefile_extra_vars [list myvar {my value} othervar value] | ||||
} | ||||
rc_var {set modulerc_extra_vars [list myvar {my value} othervar value]} | ||||
mix - override { | ||||
set modulefile_extra_cmds [list mycmd mycmd othercmd mycmd2] | ||||
set modulerc_extra_cmds [list mycmd mycmd othercmd mycmd2] | ||||
set modulefile_extra_vars [list myvar value] | ||||
set modulerc_extra_vars [list myvar value] | ||||
} | ||||
} | ||||
} | ||||
} | } | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 107 lines changed or added |