diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-12-01 16:25:59 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-12-01 16:25:59 +0000 |
commit | dc706721e6e9f2c6c15469c4e65a8f5c64276ec1 (patch) | |
tree | 2d4857ad9edf5e9cd49376d62df8311177b66aac /gcc | |
parent | f3447c36c655d94b3bbc9eba97d24623181cac8c (diff) | |
download | gcc-dc706721e6e9f2c6c15469c4e65a8f5c64276ec1.zip gcc-dc706721e6e9f2c6c15469c4e65a8f5c64276ec1.tar.gz gcc-dc706721e6e9f2c6c15469c4e65a8f5c64276ec1.tar.bz2 |
jit.exp: Verify the exit status of the spawnee
gcc/testsuite/ChangeLog:
* jit.dg/jit.exp (verify_exit_status): New function.
(fixed_host_execute): Verify the exit status of the spawnee.
From-SVN: r218229
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/jit.dg/jit.exp | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2f2dfd..7378542 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2014-12-01 David Malcolm <dmalcolm@redhat.com> + * jit.dg/jit.exp (verify_exit_status): New function. + (fixed_host_execute): Verify the exit status of the spawnee. + +2014-12-01 David Malcolm <dmalcolm@redhat.com> + * jit.dg/jit.exp (fixed_host_execute): Fix timeout bug. 2014-12-01 David Malcolm <dmalcolm@redhat.com> diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp index 2edd048..a37ccc7 100644 --- a/gcc/testsuite/jit.dg/jit.exp +++ b/gcc/testsuite/jit.dg/jit.exp @@ -65,6 +65,35 @@ proc parse_valgrind_logfile {name logfile} { close $f } +# Given WRES, the result from "wait", issue a PASS +# if the spawnee exited cleanly, or a FAIL for various kinds of +# unexpected exits. + +proc verify_exit_status { executable wres } { + lassign $wres pid spawnid os_error_flag value + verbose "pid: $pid" 3 + verbose "spawnid: $spawnid" 3 + verbose "os_error_flag: $os_error_flag" 3 + verbose "value: $value" 3 + + # Detect segfaults etc: + if { [llength $wres] > 4 } { + if { [lindex $wres 4] == "CHILDKILLED" } { + fail "$executable killed: $wres" + return + } + } + if { $os_error_flag != 0 } { + fail "$executable: OS error: $wres" + return + } + if { $value != 0 } { + fail "$executable: non-zero exit code: $wres" + return + } + pass "$executable exited cleanly" +} + # This is host_execute from dejagnu.exp commit # 126a089777158a7891ff975473939f08c0e31a1c # with the following patch applied, and renaming to "fixed_host_execute". @@ -214,6 +243,7 @@ proc fixed_host_execute {args} { catch wait wres verbose "wres: $wres" 2 + verify_exit_status $executable $wres if $run_under_valgrind { upvar 2 name name |