From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] sim; testsuite: allow tests to set no output
Date: Sun, 29 Mar 2015 20:47:00 -0000 [thread overview]
Message-ID: <1427662026-27856-1-git-send-email-vapier@gentoo.org> (raw)
If a test doesn't write anything at all to stdout, the current test
framework can't support that. Even if you put a blank output line:
# output:
the setup happily clobbers that with a default pass/fail string.
Tweak the parsing logic so we only set the output to pass/fail when
the test has no output marker.
---
sim/testsuite/ChangeLog | 6 ++++++
sim/testsuite/lib/sim-defs.exp | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 6de8bdc..55ef169 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2015-03-29 Mike Frysinger <vapier@gentoo.org>
+ * lib/sim-defs.exp (run_sim_test): Declare seen_output as 0. When
+ the test has an output keyword, set it to 1. Set default output only
+ when seen_output is 0.
+
+2015-03-29 Mike Frysinger <vapier@gentoo.org>
+
* configure: Regenerate.
2015-03-28 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index c8093a2..fb2346a 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -218,6 +218,7 @@ proc run_sim_test { name requested_machs } {
set opts(xerror) "no"
set opts(xfail) ""
set opts(kfail) ""
+ set seen_output 0
if ![info exists global_as_options] {
set global_as_options ""
@@ -260,6 +261,7 @@ proc run_sim_test { name requested_machs } {
# Multiple "output" specifications concatenate, they don't override.
if { $opt_name == "output" } {
set opt_val "$opts(output)$opt_val"
+ set seen_output 1
}
# Similar with "xfail" and "kfail", but arguments are space-separated.
if { $opt_name == "xfail" || $opt_name == "kfail" } {
@@ -276,7 +278,7 @@ proc run_sim_test { name requested_machs } {
set testname $name
set sourcefile $file
- if { $opts(output) == "" } {
+ if { $seen_output == 0 } {
if { "$opts(xerror)" == "no" } {
set opts(output) "pass\n"
} else {
--
2.3.4
next reply other threads:[~2015-03-29 20:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 20:47 Mike Frysinger [this message]
2015-03-29 20:47 ` [PATCH 2/2] sim: microblaze: start a testsuite Mike Frysinger
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=1427662026-27856-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).