Skip to content

Commit

Permalink
ts: fix tests when run with Tcl 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Feb 12, 2023
1 parent 009c203 commit 4d749f1
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 16 deletions.
108 changes: 94 additions & 14 deletions testsuite/modules.50-cmds/400-source-sh.exp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,14 @@ setenv\t\tFOOSP {value }
setenv\t\tFOOWC va*ue
module-whatis\tsource-sh/1
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1 xfail
} else {
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
}
set tserr_disp2 "-------------------------------------------------------------------
$mp/source-sh/4.3:

Expand Down Expand Up @@ -518,7 +525,14 @@ $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/4.3.
$modlin"

# test 'display' sub-command when no module loaded
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1 xfail
} else {
testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
}
testouterr_cmd sh {display source-sh/4.3} ERR $tserr_disp2
set tserr_disp3 "-------------------------------------------------------------------
$mp/source-sh/5.0:
Expand Down Expand Up @@ -584,7 +598,14 @@ setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
setenv FOOPATHDUP {/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3}
setenv FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3 xfail
} else {
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
}
set tserr_disp4 "-------------------------------------------------------------------
$mp/source-sh/5.1:

Expand Down Expand Up @@ -650,7 +671,14 @@ setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
setenv FOOPATHDUP {/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3}
setenv FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/5.1} OK $tserr_disp4
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/5.1} OK $tserr_disp4 xfail
} else {
testouterr_cmd sh {display source-sh/5.1} OK $tserr_disp4
}

#
# erroneous call or script
Expand Down Expand Up @@ -1018,7 +1046,14 @@ set-alias alunk {}
set-function funcunk {}
complete bash compunk {}
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3 xfail
} else {
testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
}

# clear source-sh details recorded in env yet module is still loaded
unsetenv_var __MODULES_LMSOURCESH
Expand Down Expand Up @@ -1173,8 +1208,16 @@ setenv\t\tFOOSP {value }
setenv\t\tFOOWC va*ue
module-whatis\tsource-sh/7.0
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/7.0} OK $tserr_disp70
testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/7.0} OK $tserr_disp70 xfail
testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70 xfail
} else {
testouterr_cmd sh {display source-sh/7.0} OK $tserr_disp70
testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
}

setenv_loaded_module [list source-sh/7.0] [list $mp/source-sh/7.0]
setenv_var __MODULES_LMREFRESH source-sh/7.0
Expand Down Expand Up @@ -1214,7 +1257,14 @@ lappend ans [list out {complete othercmd 'n/--help/n/';}]
lappend ans [list out {complete mycmd 'n/help/`_module_avail`/' 'n/add/`_module_not_yet_loaded; echo "--auto --no-auto --force -f --icase -i --tag --tag="`/';}]
testouterr_cmd tcsh {refresh} $ans {}

testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70 xfail
} else {
testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
}

unsetenv_loaded_module
unsetenv_var __MODULES_LMREFRESH
Expand Down Expand Up @@ -1294,8 +1344,16 @@ setenv\t\tFOOSP {value }
setenv\t\tFOOWC va*ue
module-whatis\tsource-sh/7.1
-------------------------------------------------------------------"
testouterr_cmd sh {display source-sh/7.1} OK $tserr_disp71
testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/7.1} OK $tserr_disp71 xfail
testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71 xfail
} else {
testouterr_cmd sh {display source-sh/7.1} OK $tserr_disp71
testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
}

setenv_loaded_module [list source-sh/7.1] [list $mp/source-sh/7.1]
setenv_var __MODULES_LMREFRESH source-sh/7.1
Expand Down Expand Up @@ -1348,7 +1406,14 @@ lappend ans [list out {complete -u othercmd;}]
lappend ans [list out {complete -j -P '"%' -S '"' mycmd;}]
testouterr_cmd bash {refresh} $ans {}

testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71 xfail
} else {
testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
}

unsetenv_loaded_module
unsetenv_var __MODULES_LMREFRESH
Expand Down Expand Up @@ -1461,8 +1526,16 @@ setenv\t\tFOOWC va*ue
module-whatis\tsource-sh/7.2
-------------------------------------------------------------------"
}
testouterr_cmd sh {display source-sh/7.2} OK $tserr_disp72
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd sh {display source-sh/7.2} OK $tserr_disp72 xfail
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72 xfail
} else {
testouterr_cmd sh {display source-sh/7.2} OK $tserr_disp72
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
}

setenv_loaded_module [list source-sh/7.2] [list $mp/source-sh/7.2]
setenv_var __MODULES_LMREFRESH source-sh/7.2
Expand Down Expand Up @@ -1573,7 +1646,14 @@ setenv\t\tFOOWC va*ue
module-whatis\tsource-sh/7.2
-------------------------------------------------------------------"
}
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# similar stack trace than one reported at:
# https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72 xfail
} else {
testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
}

unsetenv_loaded_module
unsetenv_var __MODULES_LMREFRESH
Expand Down
11 changes: 9 additions & 2 deletions testsuite/modules.70-maint/410-timer.exp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,15 @@ set tserr "($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*

$total_timer"
testouterr_cmd_re sh {load foo/1.0 --debug --timer} $ans $tserr
testouterr_cmd_re sh {load foo/1.0 --debug --timer --debug} $ans $tserr
# following tests are expected to fail with Tcl 9.0 (as of 9.0b1)
# see https://core.tcl-lang.org/tcl/tktview/46dda6fc2904ee86cc45b3ddc14ce6fb6b4303e4
if {[cmpversion $tclsh_version 9.0] >= 0} {
testouterr_cmd_re sh {load foo/1.0 --debug --timer} $ans $tserr 0 xfail
testouterr_cmd_re sh {load foo/1.0 --debug --timer --debug} $ans $tserr 0 xfail
} else {
testouterr_cmd_re sh {load foo/1.0 --debug --timer} $ans $tserr
testouterr_cmd_re sh {load foo/1.0 --debug --timer --debug} $ans $tserr
}

set tserr "($timer_msgs .* \\\(\\d+.\\d+ ms\\\))*
$no_loaded
Expand Down

0 comments on commit 4d749f1

Please sign in to comment.