This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch, testsuite] Skip gnu-ifunc tests if building the testcase fails
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 25 Sep 2018 23:08:45 -0600
- Subject: [patch, testsuite] Skip gnu-ifunc tests if building the testcase fails
gdb.base/gnu-ifunc.exp doesn't fail gracefully on targets that don't
support this feature -- on nios2-linux-gnu I've seen TCL errors from
trying to copy the nonexistent shared library that fails to build to the
target.
I see that ld/testsuite/ld-ifunc/ifunc.exp explicitly lists all the
targets where IFUNC is expected to work, but it seemed more maintainable
to me to tweak these gdb tests to pay attention to the return status
from trying to build the test cases. Is this OK to commit?
-Sandra
commit 1e4269b8d83d6c8cdb5351efa2b346a714a250aa
Author: Sandra Loosemore <sandra@codesourcery.com>
Date: Tue Sep 25 21:54:52 2018 -0700
Skip gnu-ifunc tests if building the testcase fails.
2018-09-25 Sandra Loosemore <sandra@codesourcery.com>
* gdb.base/gnu-ifunc.exp: Skip tests if building testcase fails.
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d15fcff..72bf6bd 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-09-25 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gdb.base/gnu-ifunc.exp: Skip tests if building testcase fails.
+
2018-09-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
PR gdb/20948
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index d6ec698..ffaf254 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -365,9 +365,10 @@ proc misc_tests {resolver_attr resolver_debug final_debug} {
foreach_with_prefix resolver_attr {0 1} {
foreach_with_prefix resolver_debug {0 1} {
foreach_with_prefix final_debug {0 1} {
- build $resolver_attr $resolver_debug $final_debug
- misc_tests $resolver_attr $resolver_debug $final_debug
- set-break $resolver_attr $resolver_debug $final_debug
+ if { [build $resolver_attr $resolver_debug $final_debug] != 0 } {
+ misc_tests $resolver_attr $resolver_debug $final_debug
+ set-break $resolver_attr $resolver_debug $final_debug
+ }
}
}
}