From: "Sourceware to Gerrit sync (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
Tom Tromey <tromey@sourceware.org>
Subject: [pushed] gdb/testsuite: Introduce skip_ctf_tests guard function
Date: Tue, 19 Nov 2019 00:47:00 -0000 [thread overview]
Message-ID: <20191119004709.8CC6428172@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571177353000.I505c11169a9bc9871a31fc0c61e119f92f32cc63@gnutoolchain-gerrit.osci.io>
Sourceware to Gerrit sync has submitted this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/121
......................................................................
gdb/testsuite: Introduce skip_ctf_tests guard function
Most versions of GCC in the wild don't support CTF debug format right
now, so, rather than attempting to compile the tests and failing each
time, this patch introduces a guard function to check if the compiler
supports CTF. If we don't have CTF support then the CTF tests are
skipped.
This patch only updates 3 of the 4 CTF tests, the fourth will be
handled in the next patch.
gdb/testsuite/ChangeLog:
* gdb.base/ctf-constvars.exp: Skip test if CTF is not supported in
the compiler. Clean up header comment a little.
* gdb.base/ctf-ptype.exp: Likewise.
* gdb.base/ctf-whatis.exp: Likewise.
* lib/gdb.exp (skip_ctf_tests): New proc.
Change-Id: I505c11169a9bc9871a31fc0c61e119f92f32cc63
---
M gdb/testsuite/ChangeLog
M gdb/testsuite/gdb.base/ctf-constvars.exp
M gdb/testsuite/gdb.base/ctf-ptype.exp
M gdb/testsuite/gdb.base/ctf-whatis.exp
M gdb/testsuite/lib/gdb.exp
5 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index de8712a..f924966 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2019-11-19 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.base/ctf-constvars.exp: Skip test if CTF is not supported in
+ the compiler. Clean up header comment a little.
+ * gdb.base/ctf-ptype.exp: Likewise.
+ * gdb.base/ctf-whatis.exp: Likewise.
+ * lib/gdb.exp (skip_ctf_tests): New proc.
+
2019-11-18 Sergio Durigan Junior <sergiodj@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1765117
diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp
index 4a81a94..fd46d64 100644
--- a/gdb/testsuite/gdb.base/ctf-constvars.exp
+++ b/gdb/testsuite/gdb.base/ctf-constvars.exp
@@ -18,20 +18,21 @@
#
# This file is part of the gdb testsuite
#
-# tests for const variables
-# const pointers to vars
-# pointers to const variables
-# const pointers to const vars
-# with mixed types
+# Tests for: const variables,
+# const pointers to vars
+# pointers to const variables
+# const pointers to const vars
+# with mixed types.
-#
-# test running programs
-#
-# -gt generates full-fledged CTF.
+if [skip_ctf_tests] {
+ unsupported "no ctf debug format support"
+ return 0
+}
standard_testfile .c
-set opts "additional_flags=-gt"
+# Using `-gt` generates full-fledged CTF debug information.
+set opts "additional_flags=-gt"
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile] [list $opts nowarnings]] } {
return 0
diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp
index 9f54582..68a9662 100644
--- a/gdb/testsuite/gdb.base/ctf-ptype.exp
+++ b/gdb/testsuite/gdb.base/ctf-ptype.exp
@@ -15,14 +15,15 @@
# This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com)
-#
-# test running programs
-#
-# -gt generates full-fledged CTF.
+if [skip_ctf_tests] {
+ unsupported "no ctf debug format support"
+ return 0
+}
standard_testfile .c
-set opts "additional_flags=-gt"
+# Using `-gt` generates full-fledged CTF debug information.
+set opts "additional_flags=-gt"
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile] [list $opts nowarnings]] } {
return 0
diff --git a/gdb/testsuite/gdb.base/ctf-whatis.exp b/gdb/testsuite/gdb.base/ctf-whatis.exp
index 3f26fc3..626aecb 100644
--- a/gdb/testsuite/gdb.base/ctf-whatis.exp
+++ b/gdb/testsuite/gdb.base/ctf-whatis.exp
@@ -15,14 +15,15 @@
# This file is a subset of whatis.exp written by Rob Savoye. (rob@cygnus.com)
-#
-# test running programs
-#
-# -gt generates full-fledged CTF.
+if [skip_ctf_tests] {
+ unsupported "no ctf debug format support"
+ return 0
+}
standard_testfile .c
-set opts "additional_flags=-gt"
+# Using `-gt` generates full-fledged CTF debug information.
+set opts "additional_flags=-gt"
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile] [list $opts nowarnings]] } {
return 0
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 2d395ef..828c91d 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -6787,5 +6787,16 @@
}
}
+# Does the compiler support CTF debug output using '-gt' compiler
+# flag? If not then we should skip these tests.
+
+gdb_caching_proc skip_ctf_tests {
+ return ![gdb_can_simple_compile ctfdebug {
+ int main () {
+ return 0;
+ }
+ } executable "additional_flags=-gt"]
+}
+
# Always load compatibility stuff.
load_lib future.exp
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I505c11169a9bc9871a31fc0c61e119f92f32cc63
Gerrit-Change-Number: 121
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-CC: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: merged
prev parent reply other threads:[~2019-11-19 0:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 22:09 [review] gdb/testsuite: Introduce compiler_supports_ctf_debug " Andrew Burgess (Code Review)
2019-10-16 18:02 ` Tom Tromey (Code Review)
2019-10-16 20:02 ` Andrew Burgess (Code Review)
2019-10-22 16:11 ` Tom Tromey (Code Review)
2019-11-16 22:45 ` Simon Marchi (Code Review)
2019-11-18 17:53 ` [review v2] " Andrew Burgess (Code Review)
2019-11-18 17:57 ` [review v3] gdb/testsuite: Introduce skip_ctf_tests " Andrew Burgess (Code Review)
2019-11-18 18:03 ` Andrew Burgess (Code Review)
2019-11-18 18:46 ` Simon Marchi (Code Review)
2019-11-18 18:47 ` Simon Marchi (Code Review)
2019-11-19 0:47 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-19 0:47 ` Sourceware to Gerrit sync (Code Review) [this message]
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=20191119004709.8CC6428172@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=noreply@gnutoolchain-gerrit.osci.io \
--cc=simon.marchi@polymtl.ca \
--cc=tromey@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