summaryrefslogtreecommitdiffstats
path: root/tests/exec.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 18:33:34 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 18:33:34 (GMT)
commit841c2af7dcfcd20b68bd3f05f5ecce6498b35a18 (patch)
treeb1bf11da1526f8870771f95b77002ca9960b2793 /tests/exec.test
parent05f6317032522fa4b68966fe3c1ef854d87fbf6e (diff)
downloadtcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.zip
tcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.tar.gz
tcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.tar.bz2
* win/tclWinPipe.c: Applied patch #1267871 by Matt Newman which
* win/tclWinPort.h: provides extended error code support. * tests/exec.test: Wrote some tests for this feature.
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 bb6ecd4..0dccf37 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.16.2.5 2005/07/28 15:27:59 dkf Exp $
+# RCS: @(#) $Id: exec.test,v 1.16.2.6 2005/11/04 18:33:35 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 0xffffffff} 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} {