]> gcc.gnu.org Git - gcc.git/commitdiff
testsuite, jit: Stabilize error output.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 13 Jan 2024 21:14:07 +0000 (21:14 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 28 Jan 2024 10:58:33 +0000 (10:58 +0000)
Currently when a test fails, we print out a lot of information,
this includes items that are not stable between invocations (e.g.
the PID for the executable).  That makes automated comparisons
between test runs flag any persistent fails as new ones each time
which is not usually what is wanted.

This patch amends the error output to drop the variable portion
of the message and retain items that should only change if the
failure mode changes.

gcc/testsuite/ChangeLog:

* jit.dg/jit.exp: Filter error output to remove per-run
variable content.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/jit.dg/jit.exp

index 286cfa8192a59fedb02652e604bdf737fe986260..893ff5f6dd05b7b45185165da365e78a2fc161b7 100644 (file)
@@ -94,25 +94,34 @@ proc parse_valgrind_logfile {name logfile} {
 # unexpected exits.
 
 proc verify_exit_status { executable wres } {
-    lassign $wres pid spawnid os_error_flag value
+    set extra [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"
+    set len [llength $extra]
+    if { $len >= 1 } {
+       if { [lindex $extra 0] == "CHILDKILLED" } {
+           set reason "Unknown Reason"
+           set detail "No Details"
+           if { $len >= 2 } {
+               set reason [lindex $extra 1]
+               if { $len >= 3 } {
+                   set detail [lindex $extra 2]
+               }
+           }
+           fail "$executable killed: $reason $detail"
            return
        }
     }
     if { $os_error_flag != 0 } {
-       fail "$executable: OS error: $wres"
+       fail "$executable: OS error: $os_error_flag $extra"
        return
     }
     if { $value != 0 } {
-       fail "$executable: non-zero exit code: $wres"
+       fail "$executable: non-zero exit code: $value $extra"
        return
     }
     pass "$executable exited cleanly"
This page took 0.063081 seconds and 5 git commands to generate.