public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Show dwz stderr on failure
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

We redirect dwz stderr to a dwz.err file in case we're expecting some error
message, or want to grep for it, but in case the test fails in some way, we
still want to see dwz.err in the testrun output.

Fix this by adding 'cat dwz.err' where appropriate.

Committed to trunk.

Thanks,
- Tom

Show dwz stderr on failure

2019-03-16  Tom de Vries  <tdevries@suse.de>

	* testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh: Emit dwz.err on
	exit.
	* testsuite/dwz.tests/objcopy-strip-debug.sh: Same.
	* testsuite/dwz.tests/pr24174.sh: Same.
	* testsuite/dwz.tests/too-many-dies.sh: Redirect stderr to dwz.err and
	grep for expected error message.  Emit dwz.err on exit.

---
 testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh |  5 +++--
 testsuite/dwz.tests/objcopy-strip-debug.sh         |  5 +++--
 testsuite/dwz.tests/pr24174.sh                     |  1 +
 testsuite/dwz.tests/too-many-dies.sh               | 13 +++++++++++--
 4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh b/testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh
index d5cfa9c..93fa04b 100644
--- a/testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh
+++ b/testsuite/dwz.tests/objcopy-remove-debug-abbrev.sh
@@ -6,12 +6,13 @@ if dwz 1 2>dwz.err; status=$?; then
     true
 fi
 
-[ $status -eq 1 ]
-
 if ! grep -q "\.debug_abbrev not present" dwz.err; then
+    cat dwz.err
     exit 1
 fi
 
+[ $status -eq 1 ]
+
 cmp 1 1.saved
 
 rm -f 1 1.saved dwz.err
diff --git a/testsuite/dwz.tests/objcopy-strip-debug.sh b/testsuite/dwz.tests/objcopy-strip-debug.sh
index 4f1a51c..3aec669 100644
--- a/testsuite/dwz.tests/objcopy-strip-debug.sh
+++ b/testsuite/dwz.tests/objcopy-strip-debug.sh
@@ -6,12 +6,13 @@ if dwz 1 2>dwz.err; status=$?; then
     true
 fi
 
-[ $status -eq 1 ]
-
 if ! grep -q "\.debug_info section not present" dwz.err; then
+    cat dwz.err
     exit 1
 fi
 
+[ $status -eq 1 ]
+
 cmp 1 1.saved
 
 rm -f 1 1.saved dwz.err
diff --git a/testsuite/dwz.tests/pr24174.sh b/testsuite/dwz.tests/pr24174.sh
index 6543d3b..1044368 100644
--- a/testsuite/dwz.tests/pr24174.sh
+++ b/testsuite/dwz.tests/pr24174.sh
@@ -5,6 +5,7 @@ if dwz 1 2>dwz.err; status=$?; then
 fi
 
 if grep -q "DWARF version 0 unhandled" dwz.err; then
+    cat dwz.err
     exit 1
 fi
 
diff --git a/testsuite/dwz.tests/too-many-dies.sh b/testsuite/dwz.tests/too-many-dies.sh
index 23ecb01..aa2639b 100644
--- a/testsuite/dwz.tests/too-many-dies.sh
+++ b/testsuite/dwz.tests/too-many-dies.sh
@@ -1,7 +1,16 @@
 cp ../hello 1
 
-if dwz -L0 1 2>/dev/null; then exit 1; fi
+if dwz -L0 1 2>dwz.err; status=?; then
+    true
+fi
+
+if ! grep -q "Too many DIEs, not optimizing" dwz.err; then
+    cat dwz.err
+    exit 1
+fi
+
+[ $status -eq 1 ]
 
 cmp 1 ../hello
 
-rm -f 1
+rm -f 1 dwz.err

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-16 18:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Show dwz stderr on failure Tom de Vries

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).