From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
To: gdb-patches@sourceware.org
Cc: gbenson@redhat.com
Subject: [PATCH] Remove directory names from gdb.base/batch-exit-status.exp
Date: Tue, 30 Jul 2019 18:09:00 -0000 [thread overview]
Message-ID: <20190730180848.16329-1-pedromfc@linux.ibm.com> (raw)
Adjust gdb.base/batch-exit-status.exp so that test prefixes don't show
directory names for the source scripts passed with -x, to make test
results from different build directories comparable.
gdb/testsuite/ChangeLog:
YYYY-MM-DD Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* gdb.base/batch-exit-status.exp: Call test_exit_status with
prefix argument.
(test_exit_status): Add prefix argument.
---
gdb/testsuite/gdb.base/batch-exit-status.exp | 32 ++++++++++++--------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp
index 6e434e4a14..0f89115571 100644
--- a/gdb/testsuite/gdb.base/batch-exit-status.exp
+++ b/gdb/testsuite/gdb.base/batch-exit-status.exp
@@ -43,28 +43,36 @@ proc _test_exit_status {expect_status cmdline_opts} {
}
}
-proc test_exit_status {expect_status cmdline_opts} {
- with_test_prefix $cmdline_opts {
+proc test_exit_status {expect_status cmdline_opts prefix} {
+ if { $prefix == "" } {
+ set prefix $cmdline_opts
+ }
+
+ with_test_prefix $prefix {
_test_exit_status $expect_status $cmdline_opts
}
}
# gdb -batch with nothing to do should exit 0.
-test_exit_status 0 "-batch"
+test_exit_status 0 "-batch" ""
# Bad command-line options should cause exit 1.
-test_exit_status 1 "-batch -jslkflsdjlkfjlksdjf"
+test_exit_status 1 "-batch -jslkflsdjlkfjlksdjf" ""
# gdb -batch with good commands should exit 0.
-test_exit_status 0 "-batch -ex \"info source\""
-test_exit_status 0 "-batch -x $good_commands"
+test_exit_status 0 "-batch -ex \"info source\"" ""
+test_exit_status 0 "-batch -x $good_commands" "-batch -x good-commands"
# gdb -batch with bad commands should exit 1.
-test_exit_status 1 "-batch -ex \"set not-a-thing 4\""
-test_exit_status 1 "-batch -x $bad_commands"
+test_exit_status 1 "-batch -ex \"set not-a-thing 4\"" ""
+test_exit_status 1 "-batch -x $bad_commands" "-batch -x bad-commands"
# Success or failure of the last thing determines the exit code.
-test_exit_status 0 "-batch -ex \"set not-a-thing 4\" -x $good_commands"
-test_exit_status 0 "-batch -x $bad_commands -ex \"info source\""
-test_exit_status 1 "-batch -x $good_commands -x $bad_commands"
-test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\""
+test_exit_status 0 "-batch -ex \"set not-a-thing 4\" -x $good_commands" \
+ "-batch -ex \"set not-a-thing 4\" -x good-commands"
+test_exit_status 0 "-batch -x $bad_commands -ex \"info source\"" \
+ "-batch -x bad-commands -ex \"info source\""
+test_exit_status 1 "-batch -x $good_commands -x $bad_commands" \
+ "-batch -x good-commands -x bad-commands"
+test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" \
+ "-batch -x good-commands -ex \"set not-a-thing 4\""
--
2.20.1
next reply other threads:[~2019-07-30 18:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 18:09 Pedro Franco de Carvalho [this message]
2019-08-01 18:13 ` Tom Tromey
2019-08-01 19:55 ` Pedro Franco de Carvalho
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=20190730180848.16329-1-pedromfc@linux.ibm.com \
--to=pedromfc@linux.ibm.com \
--cc=gbenson@redhat.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