[committed,gdb/testsuite] Fix duplicate in gdb.base/info-macros.exp

Message ID 20210624110318.GA22285@delia
State New
Headers show
Series
  • [committed,gdb/testsuite] Fix duplicate in gdb.base/info-macros.exp
Related show

Commit Message

Tom de Vries June 24, 2021, 11:03 a.m.
Hi,

When running test-case gdb.base/info-macros.exp, I run into:
...
PASS: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro --
DUPLICATE: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro  --
...

These messages come from gdb_test calls using the following commands:
- "info macro --"
- "info macro -- "
- "info macro  -- ".

Apparantly the test names get stripped of trailing whitespace, and the first
two end up identical.

Fix this by explicitly specifying an <EOL> after the trailing whitespace in
the test name, such that we have:
...
PASS: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro -- <EOL>
PASS: gdb.base/info-macros.exp: info macro  -- <EOL>
...

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix duplicate in gdb.base/info-macros.exp

gdb/testsuite/ChangeLog:

2021-06-24  Tom de Vries  <tdevries@suse.de>

	* gdb.base/info-macros.exp: Add <EOL> after trailing whitespace in
	test names.

---
 gdb/testsuite/ChangeLog                | 5 +++++
 gdb/testsuite/gdb.base/info-macros.exp | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 73035a906da..d12aba9f8ac 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@ 
+2021-06-24  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.base/info-macros.exp: Add <EOL> after trailing whitespace in
+	test names.
+
 2021-06-24  Tom de Vries  <tdevries@suse.de>
 
 	* gdb.base/argv0-symlink.exp: Use with_test_prefix.
diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index 44b0b45988d..19f16814374 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -61,9 +61,11 @@  gdb_test "info macro --" \
 	 "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
 
 gdb_test "info macro -- " \
-	 "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+	 "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \
+	 "info macro -- <EOL>"
 gdb_test "info macro  -- " \
-	 "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+	 "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \
+	 "info macro  -- <EOL>"
 
 gdb_test "info macro -invalid-option" \
 	 "Unrecognized option.*Try \"help info macro\"\."