From 7d65d01496e465606740033f6ba76b42ddb9815b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 31 Aug 2005 15:14:26 +0000 Subject: [PATCH] Use correct exit code in test shell scripts if test cannot be performed. --- tests/ChangeLog | 20 ++++++++++++++++++++ tests/run-addrscopes.sh | 4 ++-- tests/run-allfcts.sh | 6 +++--- tests/run-ecp-test.sh | 4 ++-- tests/run-ecp-test2.sh | 4 ++-- tests/run-elflint-test.sh | 4 ++-- tests/run-funcscopes.sh | 2 +- tests/run-get-aranges.sh | 6 +++--- tests/run-get-files.sh | 6 +++--- tests/run-get-lines.sh | 6 +++--- tests/run-get-pubnames.sh | 6 +++--- tests/run-line2addr.sh | 10 +++++----- tests/run-ranlib-test2.sh | 4 ++-- tests/run-show-abbrev.sh | 6 +++--- tests/run-show-ciefde.sh | 6 +++--- tests/run-show-die-info.sh | 6 +++--- tests/run-strings-test.sh | 4 ++-- tests/run-strip-test.sh | 6 +++--- 18 files changed, 65 insertions(+), 45 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index ad426e13d..3a5d16a74 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,23 @@ +2005-08-31 Ulrich Drepper + + * run-addrscopes.sh: Use correct exit code if test cannot be performed. + * run-allfcts.sh: Likewise. + * run-ecp-test.sh: Likewise. + * run-ecp-test2.sh: Likewise. + * run-elflint-test.sh: Likewise. + * run-funcscopes.sh: Likewise. + * run-get-aranges.sh: Likewise. + * run-get-files.sh: Likewise. + * run-get-lines.sh: Likewise. + * run-get-pubnames.sh: Likewise. + * run-line2addr.sh: Likewise. + * run-ranlib-test2.sh: Likewise. + * run-show-abbrev.sh: Likewise. + * run-show-ciefde.sh: Likewise. + * run-show-die-info.sh: Likewise. + * run-strings-test.sh: Likewise. + * run-strip-test.sh: Likewise. + 2005-08-30 Ulrich Drepper * coverage.sh: Handle case where there is no .gcno file at all. diff --git a/tests/run-addrscopes.sh b/tests/run-addrscopes.sh index 57a610b81..d1e89cc85 100755 --- a/tests/run-addrscopes.sh +++ b/tests/run-addrscopes.sh @@ -13,7 +13,7 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile22.bz2 > testfile22 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile22.bz2 > testfile22 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libdw:../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ./addrscopes -e testfile22 0x8048353 >& addrscopes-test.out || : @@ -29,7 +29,7 @@ EOF rm -f testfile22 addrscopes-test.out # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile24.bz2 > testfile24 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile24.bz2 > testfile24 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libdw:../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ./addrscopes -e testfile24 0x804834e >& addrscopes-test.out || : diff --git a/tests/run-allfcts.sh b/tests/run-allfcts.sh index 51fe75cec..3fde34b9f 100755 --- a/tests/run-allfcts.sh +++ b/tests/run-allfcts.sh @@ -14,13 +14,13 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 77 ./allfcts testfile testfile2 testfile8 > allfcts.out diff --git a/tests/run-ecp-test.sh b/tests/run-ecp-test.sh index e4304965b..c21bb6ca3 100755 --- a/tests/run-ecp-test.sh +++ b/tests/run-ecp-test.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Red Hat, Inc. +# Copyright (C) 2002, 2005 Red Hat, Inc. # Written by Jakub Jelinek , 2002. # # This program is Open Source software; you can redistribute it and/or @@ -14,7 +14,7 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile10.bz2 > testfile10 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile10.bz2 > testfile10 2>/dev/null || exit 77 ./ecp testfile10 testfile10.tmp diff --git a/tests/run-ecp-test2.sh b/tests/run-ecp-test2.sh index 143c70a6e..8f3775be9 100755 --- a/tests/run-ecp-test2.sh +++ b/tests/run-ecp-test2.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Red Hat, Inc. +# Copyright (C) 2002, 2005 Red Hat, Inc. # Written by Jakub Jelinek , 2002. # # This program is Open Source software; you can redistribute it and/or @@ -14,7 +14,7 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./ecp testfile2 testfile2.tmp diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh index f008ccdc3..74727b66e 100755 --- a/tests/run-elflint-test.sh +++ b/tests/run-elflint-test.sh @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile18.bz2 > testfile18 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile18.bz2 > testfile18 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ - ../src/elflint --gnu testfile18 >& elflint-test.out || : + ../src/elflint --gnu-ld testfile18 >& elflint-test.out || : diff -u elflint-test.out - <<"EOF" section [ 8] '.rela.dyn': relocation 1: copy relocation against symbol of type FUNC diff --git a/tests/run-funcscopes.sh b/tests/run-funcscopes.sh index 7236ef919..e0dcfae16 100755 --- a/tests/run-funcscopes.sh +++ b/tests/run-funcscopes.sh @@ -13,7 +13,7 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile25.bz2 > testfile25 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile25.bz2 > testfile25 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libdw:../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ./funcscopes -e testfile25 incr >& funcscopes-test.out || : diff --git a/tests/run-get-aranges.sh b/tests/run-get-aranges.sh index 26b29863c..a816c2184 100755 --- a/tests/run-get-aranges.sh +++ b/tests/run-get-aranges.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./get-aranges testfile testfile2 > get-aranges.out diff --git a/tests/run-get-files.sh b/tests/run-get-files.sh index 7af5c139d..e80cf68d7 100755 --- a/tests/run-get-files.sh +++ b/tests/run-get-files.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2004 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2004, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./get-files testfile testfile2 > get-files.out diff --git a/tests/run-get-lines.sh b/tests/run-get-lines.sh index 70c9cd84c..2f7f85809 100755 --- a/tests/run-get-lines.sh +++ b/tests/run-get-lines.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2004 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2004, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./get-lines testfile testfile2 > get-lines.out diff --git a/tests/run-get-pubnames.sh b/tests/run-get-pubnames.sh index a232bfd2a..4c9d5c2a7 100755 --- a/tests/run-get-pubnames.sh +++ b/tests/run-get-pubnames.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2003 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2003, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./get-pubnames testfile testfile2 > get-pubnames.out diff --git a/tests/run-line2addr.sh b/tests/run-line2addr.sh index c103ae03a..91047c273 100755 --- a/tests/run-line2addr.sh +++ b/tests/run-line2addr.sh @@ -14,19 +14,19 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile8.bz2 > testfile8 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile14.bz2 > testfile14 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile14.bz2 > testfile14 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile23.bz2 > testfile23 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile23.bz2 > testfile23 2>/dev/null || exit 77 (./line2addr -e testfile f.c:4 testfile f.c:8 ./line2addr -e testfile2 m.c:6 b.c:1 diff --git a/tests/run-ranlib-test2.sh b/tests/run-ranlib-test2.sh index cce9ca7c2..6eb62f2e3 100755 --- a/tests/run-ranlib-test2.sh +++ b/tests/run-ranlib-test2.sh @@ -17,10 +17,10 @@ original=${original:-testfile19} indexed=${indexed:-testfile19.index} # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/$indexed.bz2 > $indexed 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$indexed.bz2 > $indexed 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ../src/ranlib $original diff --git a/tests/run-show-abbrev.sh b/tests/run-show-abbrev.sh index 78812a5ff..0d0ff60cd 100755 --- a/tests/run-show-abbrev.sh +++ b/tests/run-show-abbrev.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2003, 2004 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./show-abbrev testfile testfile2 > show-abbrev.out diff --git a/tests/run-show-ciefde.sh b/tests/run-show-ciefde.sh index b33553342..ac97bbb32 100755 --- a/tests/run-show-ciefde.sh +++ b/tests/run-show-ciefde.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile3.bz2 > testfile3 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile3.bz2 > testfile3 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile4.bz2 > testfile4 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile4.bz2 > testfile4 2>/dev/null || exit 77 ./show-ciefde testfile3 testfile4 > show-ciefde.out diff --git a/tests/run-show-die-info.sh b/tests/run-show-die-info.sh index 042632682..3cdfae50a 100755 --- a/tests/run-show-die-info.sh +++ b/tests/run-show-die-info.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2003, 2004 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Red Hat, Inc. # Written by Ulrich Drepper , 1999. # # This program is Open Source software; you can redistribute it and/or @@ -14,10 +14,10 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile5.bz2 > testfile5 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile5.bz2 > testfile5 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile2.bz2 > testfile2 2>/dev/null || exit 77 ./show-die-info testfile5 testfile2 > show-die-info.out diff --git a/tests/run-strings-test.sh b/tests/run-strings-test.sh index 9c744afe2..4ea7d3c3b 100755 --- a/tests/run-strings-test.sh +++ b/tests/run-strings-test.sh @@ -14,11 +14,11 @@ set -e # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile.bz2 > testfile 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. for n in $(seq 2 9); do -bunzip2 -c $srcdir/testfile$n.bz2 > testfile$n 2>/dev/null || exit 0 +bunzip2 -c $srcdir/testfile$n.bz2 > testfile$n 2>/dev/null || exit 77 done LD_LIBRARY_PATH=../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh index 526eb091c..169e8929c 100755 --- a/tests/run-strip-test.sh +++ b/tests/run-strip-test.sh @@ -18,14 +18,14 @@ stripped=${stripped:-testfile7} debugout=${debugfile:+-f testfile.debug.temp -F $debugfile} # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$original.bz2 > $original 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. -bunzip2 -c $srcdir/$stripped.bz2 > $stripped 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$stripped.bz2 > $stripped 2>/dev/null || exit 77 # Don't fail if we cannot decompress the file. test -z "$debugfile" || -bunzip2 -c $srcdir/$debugfile.bz2 > $debugfile 2>/dev/null || exit 0 +bunzip2 -c $srcdir/$debugfile.bz2 > $debugfile 2>/dev/null || exit 77 LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \ ../src/strip -o testfile.temp $debugout $original -- 2.47.2