This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 5/6] Fix unstable test names in gdb.threads/attach-into-signal.exp
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 23 Oct 2017 15:18:26 +0100
- Subject: [PATCH 5/6] Fix unstable test names in gdb.threads/attach-into-signal.exp
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D28B24E4C5
- References: <1508768307-11531-1-git-send-email-palves@redhat.com>
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:
yyyy-mm-dd Pedro Alves <palves@redhat.com>
* gdb.threads/attach-into-signal.exp (corefunc): Remove "attach
$attempt" and "stoppedtry $stoppedtry" test prefixes.
---
gdb/testsuite/gdb.threads/attach-into-signal.exp | 2 --
1 file changed, 2 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index cfb06cf..7502479 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -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} {
--
2.5.5