From f0b5f34eb1dff040384df17daa92ae95c8464482 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 12 Nov 2010 17:12:05 +0100 Subject: [PATCH] Tests defs: avoid some useless subshells. * tests/defs: In the loop on "$required" tools: avoid subshells where not needed. --- ChangeLog | 7 +++++++ tests/defs | 31 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7596418b0..480a9e672 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-12 Stefano Lattarini + Ralf Wildenhues + + Tests defs: avoid some useless subshells. + * tests/defs: In the loop on "$required" tools: avoid subshells + where not needed. + 2010-11-16 Peter Rosin Skip MSVC oriented tests if the shell is not capable. diff --git a/tests/defs b/tests/defs index 8f748b1c5..bb1625528 100644 --- a/tests/defs +++ b/tests/defs @@ -149,18 +149,18 @@ do YACC='bison -y' export YACC echo "$me: running bison --version" - ( bison --version ) || exit 77 + bison --version || exit 77 ;; bzip2) # Do not use --version, bzip2 still tries to compress stdin. echo "$me: running bzip2 --help" - ( bzip2 --help ) || exit 77 + bzip2 --help || exit 77 ;; cl) CC=cl export CC echo "$me: running $CC -?" - ( $CC -? ) || exit 77 + $CC -? || exit 77 ;; etags) # Exuberant Ctags will create a TAGS file even @@ -168,7 +168,7 @@ do # does not have such problem.) Use -o /dev/null # to make sure we do not pollute the tests/ directory. echo "$me: running etags --version -o /dev/null" - ( etags --version -o /dev/null ) || exit 77 + etags --version -o /dev/null || exit 77 ;; GNUmake) # Use --version AND -v, because SGI Make doesn't fail on --version. @@ -185,21 +185,21 @@ do CC=gcc export CC echo "$me: running $CC --version" - ( $CC --version ) || exit 77 + $CC --version || exit 77 ;; gcj) GCJ=gcj export GCJ echo "$me: running $GCJ --version" - ( $GCJ --version ) || exit 77 + $GCJ --version || exit 77 echo "$me: running $GCJ -v" - ( $GCJ -v ) || exit 77 + $GCJ -v || exit 77 ;; g++) CXX=g++ export CXX echo "$me: running $CXX --version" - ( $CXX --version ) || exit 77 + $CXX --version || exit 77 ;; icc) CC=icc @@ -209,16 +209,16 @@ do # it will try link *nothing* and complain it cannot find # main(); funny). Use -help so it does not try linking anything. echo "$me: running $CC -V -help" - ( $CC -V -help ) || exit 77 + $CC -V -help || exit 77 ;; makedepend) echo "$me: running makedepend -f-" - ( makedepend -f- ) || exit 77 + makedepend -f- || exit 77 ;; makeinfo-html) # Make sure makeinfo understands --html. echo "$me: running makeinfo --html --version" - ( makeinfo --html --version ) || exit 77 + makeinfo --html --version || exit 77 ;; non-root) # Skip this test case if the user is root. @@ -243,7 +243,7 @@ do python) # Python doesn't support --version, it has -V echo "$me: running python -V" - ( python -V ) || exit 77 + python -V || exit 77 ;; ro-dir) # Skip this test case if read-only directories aren't supported @@ -275,7 +275,7 @@ do # the program on the runtest command-line. This requires # DejaGnu 1.4.3 or later. echo "$me: running runtest SOMEPROGRAM=someprogram --version" - (runtest SOMEPROGRAM=someprogram --version) || exit 77 + runtest SOMEPROGRAM=someprogram --version || exit 77 ;; tex) # No all versions of Tex support `--version', so we use @@ -288,7 +288,7 @@ do texi2dvi-o) # Texi2dvi supports `-o' since Texinfo 4.1. echo "$me: running texi2dvi -o /dev/null --version" - ( texi2dvi -o /dev/null --version ) || exit 77 + texi2dvi -o /dev/null --version || exit 77 ;; xsi-shell) # Try some XSI features. @@ -302,6 +302,9 @@ do *) # Generic case: the tool must support --version. echo "$me: running $tool --version" + # It is not likely but possible that $tool is a special builtin, + # in which case the shell is allowed to exit after an error. + # So, please leave the subshell here. ( $tool --version ) || exit 77 ;; esac -- 2.47.2