Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFC][gdb/testsuite] Add gdbfail/envfail aliases for kfail/xfail
Date: Thu, 30 Apr 2020 08:43:20 +0200	[thread overview]
Message-ID: <20200430064319.GA24688@delia> (raw)

Hi,

The difference between an xfail and a kfail (in the context of gdb testing) is
that:
- a kfail marks a problem in gdb
- an xfail marks a problem in the environment (compiler, libc, kernel)

However, this difference is not immediately obvious from the contrast between
"known" and "expected".

Add aliases gdbfail for kfail, and envfail for xfail, that are more intuitive
to use.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Add gdbfail/envfail aliases for kfail/xfail

gdb/testsuite/ChangeLog:

2020-04-30  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (gdbfail, envfail, setup_gdbfail, setup_envfail): New
	proc.
	* gdb.ada/packed_tagged.exp: Fix incorrectly marked kfails, by using
	envfail.

---
 gdb/testsuite/gdb.ada/packed_tagged.exp | 12 ++++++------
 gdb/testsuite/lib/gdb.exp               | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/packed_tagged.exp b/gdb/testsuite/gdb.ada/packed_tagged.exp
index d6ee8454c5a..1e965cffda1 100644
--- a/gdb/testsuite/gdb.ada/packed_tagged.exp
+++ b/gdb/testsuite/gdb.ada/packed_tagged.exp
@@ -38,16 +38,16 @@ foreach_with_prefix scenario {all minimal} {
     set pass_re \
 	"= \\(exists => true, value => 10\\)"
     # There is a compiler bug that causes this output.
-    set kfail_re \
+    set envfail_re \
 	"= \\(exists => true\\)"
 
     gdb_test_multiple "print x" "" {
 	-re -wrap $pass_re {
 	    pass $gdb_test_name
 	}
-	-re -wrap $kfail_re {
+	-re -wrap $envfail_re {
 	    if {$scenario == "minimal"} {
-		setup_kfail "gnat compiler bug" *-*-*
+		setup_envfail "gnat compiler bug" *-*-*
 	    }
 	    fail $gdb_test_name
 	}
@@ -63,7 +63,7 @@ foreach_with_prefix scenario {all minimal} {
 	     "    end case;" \
 	     "end record" ]
     # There is a compiler bug that causes this output.
-    set kfail_re \
+    set envfail_re \
 	[multi_line "type = record" \
 	     "    exists: (boolean|range false \\.\\. true);" \
 	     "    case \\? is" \
@@ -77,9 +77,9 @@ foreach_with_prefix scenario {all minimal} {
 	-re -wrap $pass_re {
 	    pass $gdb_test_name
 	}
-	-re -wrap $kfail_re {
+	-re -wrap $envfail_re {
 	    if {$scenario == "minimal"} {
-		setup_kfail "gnat compiler bug" *-*-*
+		setup_envfail "gnat compiler bug" *-*-*
 	    }
 	    fail $gdb_test_name
 	}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b72ce0cda7f..00efe280a43 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7124,5 +7124,31 @@ proc debug_types { } {
     return 0
 }
 
+# Alias for kfail, to make the distinction between kfail and xfail clearer.
+
+proc gdbfail { args } {
+    kfail {*}$args
+}
+
+# Alias for xfail, to make the distinction between kfail and xfail clearer.
+
+proc envfail { args } {
+    xfail {*}$args
+}
+
+# Alias for setup_kfail, to make the distinction between kfail and xfail
+# clearer.
+
+proc setup_gdbfail { args } {
+    setup_kfail {*}$args
+}
+
+# Alias for setup_xfail, to make the distinction between kfail and xfail
+# clearer.
+
+proc setup_envfail { args } {
+    setup_xfail {*}$args
+}
+
 # Always load compatibility stuff.
 load_lib future.exp


             reply	other threads:[~2020-04-30  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  6:43 Tom de Vries [this message]
2020-06-20 15:46 ` Pedro Alves

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=20200430064319.GA24688@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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