summaryrefslogtreecommitdiffstats
path: root/tests/exec.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 23:01:39 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 23:01:39 (GMT)
commit2feffdc81ee352036ee1519395ff9e5dcab96867 (patch)
treead307b6f7f7d668f3002bfa09ea7896295955457 /tests/exec.test
parenta371489bc6ceddc40588b7fc34595e01989d633d (diff)
downloadtcl-2feffdc81ee352036ee1519395ff9e5dcab96867.zip
tcl-2feffdc81ee352036ee1519395ff9e5dcab96867.tar.gz
tcl-2feffdc81ee352036ee1519395ff9e5dcab96867.tar.bz2
* win/tclWinPort.h: Applied patch #1267871 by Matt Newman for
* win/tclWinPipe.c: extended error code support on Windows. * tests/exec.test: Tests for extended error codes. * generic/tclPipe.c: Permit long codes (platform macros permitting).
Diffstat (limited to 'tests/exec.test')
-rw-r--r--tests/exec.test47
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} {