diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/exec.test | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/tests/exec.test b/tests/exec.test index a80aaeb..6575bf6 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: exec.test,v 1.23 2005/07/28 10:55:37 dkf Exp $ +# RCS: @(#) $Id: exec.test,v 1.24 2005/11/04 23:01:40 patthoyts Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -485,6 +485,51 @@ test exec-13.3 {setting errorCode variable} {exec} { [string tolower [lrange $errorCode 2 end]] } {1 {couldn't execute "_weird_cmd_": no such file or directory} POSIX {{no such file or directory}}} +test exec-13.4 {extended exit result codes} { + -constraints {win} + -setup { + set tmp [makeFile {exit 0x00000101} tmpfile.exec-13.4] + } + -body { + list [catch {exec [interpreter] $tmp} err]\ + [lreplace $::errorCode 1 1 {}] + } + -cleanup { + removeFile $tmp + } + -result {1 {CHILDSTATUS {} 257}} +} + +test exec-13.5 {extended exit result codes: max value} { + -constraints {win} + -setup { + set tmp [makeFile {exit 0x3fffffff} tmpfile.exec-13.5] + } + -body { + list [catch {exec [interpreter] $tmp} err]\ + [lreplace $::errorCode 1 1 {}] + } + -cleanup { + removeFile $tmp + } + -result {1 {CHILDSTATUS {} 1073741823}} +} + +test exec-13.6 {extended exit result codes: signalled} { + -constraints {win} + -setup { + set tmp [makeFile {exit 0xC0000016} tmpfile.exec-13.6] + } + -body { + list [catch {exec [interpreter] $tmp} err]\ + [lreplace $::errorCode 1 1 {}] + } + -cleanup { + removeFile $tmp + } + -result {1 {CHILDKILLED {} SIGABRT SIGABRT}} +} + # Switches before the first argument test exec-14.1 {-keepnewline switch} {exec} { |