Fix unstable test names in gdb.threads/attach-into-signal.exp
authorPedro Alves <palves@redhat.com>
Tue, 24 Oct 2017 09:43:35 +0000 (10:43 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 24 Oct 2017 09:54:12 +0000 (10:54 +0100)
Currently, if you diff testsuite/gdb.sum of two testsuite runs you'll
often see spurious hunks like these:

  -PASS: gdb.threads/attach-into-signal.exp: nonthreaded: attempt 2: attach (pass 2), pending signal catch
  +PASS: gdb.threads/attach-into-signal.exp: nonthreaded: attempt 1: attach (pass 2), pending signal catch
   PASS: gdb.threads/attach-into-signal.exp: successfully compiled posix threads test case
   PASS: gdb.threads/attach-into-signal.exp: threaded: handle SIGALRM stop print pass
  -PASS: gdb.threads/attach-into-signal.exp: threaded: attempt 1: attach (pass 1), pending signal catch
  -PASS: gdb.threads/attach-into-signal.exp: threaded: attempt 1: attach (pass 2), pending signal catch
  +PASS: gdb.threads/attach-into-signal.exp: threaded: attempt 2: attach (pass 1), pending signal catch
  +PASS: gdb.threads/attach-into-signal.exp: threaded: attempt 4: attach (pass 2), pending signal catch

Fix this by removing the "attempt $attempt" test prefix.  The attempt
number can be retrieved from gdb.log instead, since the testcase is
already using "verbose -log" to that effect.

(The 'with_test_prefix "stoppedtry $stoppedtry"' prefix is unnecessary
too, because inside that block there are no pass/fail calls.  In fact
the block includes a comment saying:

  # No PASS message as we may be looping in multiple
  # attempts.

but I'll drop that whole loop in the next patch instead.)

After this commit we'll show:

  PASS: gdb.threads/attach-into-signal.exp: nonthreaded: handle SIGALRM stop print pass
  PASS: gdb.threads/attach-into-signal.exp: nonthreaded: attach (pass 1), pending signal catch
  PASS: gdb.threads/attach-into-signal.exp: nonthreaded: attach (pass 2), pending signal catch
  PASS: gdb.threads/attach-into-signal.exp: successfully compiled posix threads test case
  PASS: gdb.threads/attach-into-signal.exp: threaded: handle SIGALRM stop print pass
  PASS: gdb.threads/attach-into-signal.exp: threaded: attach (pass 1), pending signal catch
  PASS: gdb.threads/attach-into-signal.exp: threaded: attach (pass 2), pending signal catch

(I've avoided reindenting to make the patch easier to maintain/read.
I'll reindent the blocks after this is in.)

gdb/testsuite/ChangeLog:
2017-10-24  Pedro Alves  <palves@redhat.com>

* gdb.threads/attach-into-signal.exp (corefunc): Remove "attach
$attempt" test prefix.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/attach-into-signal.exp

index c0a14173eec21964cc43a12ae11acd3136c2b9ee..0038a0cda232d95cda524773fdbfcf88ae2d3604 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-24  Pedro Alves  <palves@redhat.com>
+
+       * gdb.threads/attach-into-signal.exp (corefunc): Remove "attach
+       $attempt" and "stoppedtry $stoppedtry" test prefixes.
+
 2017-10-24  Pedro Alves  <palves@redhat.com>
 
        * lib/gdb-python.exp (get_python_valueof): Add 'test' optional
index cfb06cf515df5788349601061774806ec70a8be3..75024790b81e9e939ab88a55b3173707b4deae2f 100644 (file)
@@ -56,7 +56,6 @@ proc corefunc { threadtype executable } {
        set attempt 1
        set passes 1
        while { $passes < 3 && $attempt <= $attempts } {
-           with_test_prefix "attempt $attempt" {
                set stoppedtry 0
                while { $stoppedtry < 10 } {
                    with_test_prefix "stoppedtry $stoppedtry" {
@@ -128,7 +127,6 @@ proc corefunc { threadtype executable } {
                }
 
                gdb_test "detach" "Detaching from.*" ""
-           }
        }
 
        if {$passes < 3} {