public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Don't attempt tests if they fail to compile
@ 2018-01-11 19:01 Andrew Burgess
  2018-01-11 22:04 ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Burgess @ 2018-01-11 19:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

In the gdb.base/whatis-ptype-typedefs.exp test, if the test program
fails to compile, don't run the tests.

gdb/testsuite/ChangeLog:

	* gdb.base/whatis-ptype-typedefs.exp: Don't run tests if we failed
	to prepare.
	(prepare): Return 0 on error, 1 on success.
---
 gdb/testsuite/ChangeLog                          | 6 ++++++
 gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp | 9 ++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
index 763d2a43952..3d910df5d02 100644
--- a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
+++ b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
@@ -45,13 +45,15 @@ proc prepare {lang} {
 
     if { [prepare_for_testing "failed to prepare" \
 	      ${out} [list $srcfile] $options] } {
-	return -1
+	return 0
     }
 
     if ![runto_main] then {
 	fail "can't run to main"
 	return 0
     }
+
+    return 1
 }
 
 # The following list is layed out as a table.  It is composed by
@@ -300,6 +302,7 @@ proc run_tests {lang} {
 }
 
 foreach_with_prefix lang {"c" "c++"} {
-    prepare $lang
-    run_tests $lang
+    if { [prepare $lang] } then {
+	run_tests $lang
+    }
 }
-- 
2.12.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-12 12:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11 19:01 [PATCH] gdb/testsuite: Don't attempt tests if they fail to compile Andrew Burgess
2018-01-11 22:04 ` Simon Marchi
2018-01-12 10:23   ` Andrew Burgess
2018-01-12 11:46     ` Joel Brobecker
2018-01-12 12:36     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).