Ping.

--Alan

On 10/12/15 10:31, Alan Lawrence wrote:
Runs of the guality testsuite can sometimes end up with gcc.log containing
malformed lines like:

A debugging session is active.PASS: gcc.dg/guality/pr36728-1.c   -O2  line 18 
arg4 == 4
A debugging session is active.PASS: gcc.dg/guality/restrict.c   -O2  line 30 
type:ip == int *
        Inferior 1 [process 27054] will be killed.PASS: 
gcc.dg/guality/restrict.c   -O2  line 30 type:cicrp == const int * const 
restrict
        Inferior 1 [process 27160] will be killed.PASS: 
gcc.dg/guality/restrict.c   -O2  line 30 type:cvirp == int * const volatile 
restrict

This patch just makes sure the PASS/FAIL comes at the beginning of a line.  (At
the slight cost of adding some extra newlines not in the actual test output.)

I moved the remote_close target calls earlier, to avoid any possible race
condition of extra output being generated after the newline - this may not be
strictly necessary.

Tested on aarch64-none-linux-gnu and x86_64-none-linux-gnu.

I think this is reasonable for stage 3 - OK for trunk?

gcc/testsuite/ChangeLog:
        * lib/gcc-gdb-test.exp (gdb-test): call remote_close earlier, and send
        newline to log, before calling pass/fail/unsupported.
        * lib/gcc-simulate-thread.exp (simulate-thread): Likewise.
---
  gcc/testsuite/lib/gcc-gdb-test.exp        | 15 ++++++++++-----
  gcc/testsuite/lib/gcc-simulate-thread.exp | 10 +++++++---
  2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp 
b/gcc/testsuite/lib/gcc-gdb-test.exp
index d3ba6e4..f60cabf 100644
--- a/gcc/testsuite/lib/gcc-gdb-test.exp
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -84,8 +84,9 @@ proc gdb-test { args } {
      remote_expect target [timeout_value] {
        # Too old GDB
        -re "Unhandled dwarf expression|Error in sourced command file|<unknown type 
in " {
-           unsupported "$testname"
            remote_close target
+           send_log "\n"
+           unsupported "$testname"
            file delete $cmd_file
            return
        }
@@ -93,7 +94,9 @@ proc gdb-test { args } {
        -re {[\n\r]\$1 = ([^\n\r]*)[\n\r]+\$2 = ([^\n\r]*)[\n\r]} {
            set first $expect_out(1,string)
            set second $expect_out(2,string)
+           remote_close target
            if { $first == $second } {
+               send_log "\n"
                pass "$testname"
            } else {
                # We need the -- to disambiguate $first from an option,
@@ -101,7 +104,6 @@ proc gdb-test { args } {
                send_log -- "$first != $second\n"
                fail "$testname"
            }
-           remote_close target
            file delete $cmd_file
            return
        }
@@ -116,26 +118,29 @@ proc gdb-test { args } {
            regsub -all {\mlong int\M} $type "long" type
            regsub -all {\mshort int\M} $type "short" type
            set expected [lindex $args 2]
+           remote_close target
            if { $type == $expected } {
+               send_log "\n"
                pass "$testname"
            } else {
                send_log -- "$type != $expected\n"
                fail "$testname"
            }
-           remote_close target
            file delete $cmd_file
            return
        }
        timeout {
-           unsupported "$testname"
            remote_close target
+           send_log "\n"
+           unsupported "$testname"
            file delete $cmd_file
            return
        }
      }

-    unsupported "$testname"
      remote_close target
+    send_log "\n"
+    unsupported "$testname"
      file delete $cmd_file
      return
  }
diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp 
b/gcc/testsuite/lib/gcc-simulate-thread.exp
index f4275d7..6809636 100644
--- a/gcc/testsuite/lib/gcc-simulate-thread.exp
+++ b/gcc/testsuite/lib/gcc-simulate-thread.exp
@@ -61,13 +61,15 @@ proc simulate-thread { args } {
      remote_expect target [timeout_value] {
        # Too old GDB
        -re "Unhandled dwarf expression|Error in sourced command file" {
-           unsupported "$testcase $message"
            remote_close target
+           send_log "\n"
+           unsupported "$testcase $message"
            return
        }
        -re "FAIL:" {
-           fail "$testcase $message"
            remote_close target
+           send_log "\n"
+           fail "$testcase $message"
            return
        }
        # If the gdb output contained simulate_thread_done, assume
@@ -78,13 +80,15 @@ proc simulate-thread { args } {
            exp_continue
        }
        timeout {
-           fail "$testcase $message"
            remote_close target
+           send_log "\n"
+           fail "$testcase $message"
            return
        }
      }

      remote_close target
+    send_log "\n"
      if {$gdb_worked} {
        pass "$testcase $message"
      } else {


  • Re: [PATCH][Testsuite]Cleanup logs from gdb tests by adding ... Alan Lawrence

Reply via email to