aboutsummaryrefslogtreecommitdiff
path: root/tests/runall.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-05-02 16:28:53 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-06 08:18:25 +1000
commit4c8046df1368a00dae6075a4f1e493991cd95742 (patch)
tree37b0ea225330a0822ed48d5c6b11b54279b1fdc5 /tests/runall.tcl
parentcc15115823f58221212ac42394243dc032732785 (diff)
downloadjimtcl-4c8046df1368a00dae6075a4f1e493991cd95742.zip
jimtcl-4c8046df1368a00dae6075a4f1e493991cd95742.tar.gz
jimtcl-4c8046df1368a00dae6075a4f1e493991cd95742.tar.bz2
tests/runall.tcl: support tests that fork
Because we use catch -exit { ... }, if a test uses os.fork we will return in both the parent in the child. To fix this, require the child to use exit 99, and detect this case and exit from the child in this case. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/runall.tcl')
-rw-r--r--tests/runall.tcl7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/runall.tcl b/tests/runall.tcl
index 2b1c15a..4dfa539 100644
--- a/tests/runall.tcl
+++ b/tests/runall.tcl
@@ -44,6 +44,13 @@ if {[info commands interp] eq ""} {
if {[info returncode $opts(-code)] eq "error"} {
puts [format "%16s: --- error ($msg)" $script]
incr total(fail)
+ } elseif {[info return $opts(-code)] eq "exit"} {
+ # if the test explicitly called exit 99,
+ # it must be from a child process via os.fork, so
+ # silently exit
+ if {$msg eq "99"} {
+ exit 0
+ }
}
# Extract the counts