Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH] gdb/testsuite: Don't attempt tests if they fail to compile
Date: Thu, 11 Jan 2018 19:01:00 -0000	[thread overview]
Message-ID: <20180111190055.4875-1-andrew.burgess@embecosm.com> (raw)

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


             reply	other threads:[~2018-01-11 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 19:01 Andrew Burgess [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180111190055.4875-1-andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox