tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / tap-more.sh
old mode 100755 (executable)
new mode 100644 (file)
index b25ffce..19d2e61
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 #    correct test script(s)
 #  - "make distcheck" works
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
@@ -85,7 +85,7 @@ for try in 0 1; do
     mkdir build
     cd build
     srcdir=..
-    run_make=$MAKE
+    am_make=$MAKE
   elif test $try -eq 1; then
     # In-tree parallel build.
     srcdir=.
@@ -93,7 +93,7 @@ for try in 0 1; do
       *\ -j*)
         # Degree of parallelism already specified by the user: do
         # not override it.
-        run_make=$MAKE
+        :
         ;;
       *)
         # Some make implementations (e.g., HP-UX) don't grok '-j',
@@ -102,10 +102,12 @@ for try in 0 1; do
         # space between '-j' and the number of jobs (e.g., Solaris
         # dmake).  We need a runtime test to see what works.
         echo 'all:' > Makefile
-        for run_make in "$MAKE -j3" "$MAKE -j 3" "$MAKE"; do
-          $run_make && break
+        for am_make in "$MAKE -j3" "$MAKE -j 3" "$MAKE"; do
+          $am_make && break
         done
         rm -f Makefile
+        MAKE=$am_make
+        unset am_make
         ;;
     esac
   else
@@ -117,13 +119,7 @@ for try in 0 1; do
 
   # Success.
 
-  # Use append mode here to avoid dropping output.  See automake bug#11413.
-  # Also, use 'echo' here to "nullify" the previous contents of 'stdout',
-  # since Solaris 10 /bin/sh would try to optimize a ':' away after the
-  # first iteration, even if it is redirected.
-  echo " " >stdout
-  $run_make check >>stdout || { cat stdout; exit 1; }
-  cat stdout
+  run_make -O check
   count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0
   grep '^PASS: 1\.test 1 - mu$' stdout
   grep '^SKIP: 1\.test 2 zardoz # SKIP$' stdout
@@ -138,17 +134,9 @@ for try in 0 1; do
 
   # Failure.
 
-  # Use 'echo' here, since Solaris 10 /bin/sh would try to optimize
-  # a ':' away after the first iteration, even if it is redirected.
-  echo dummy > not-skip
-  echo dummy > bail-out
-  # Use append mode here to avoid dropping output.  See automake bug#11413.
-  # Also, use 'echo' here to "nullify" the previous contents of 'stdout',
-  # since Solaris 10 /bin/sh would try to optimize a ':' away after the
-  # first iteration, even if it is redirected.
-  echo " " >stdout
-  $run_make check >>stdout && { cat stdout; exit 1; }
-  cat stdout
+  : > not-skip
+  : > bail-out
+  run_make -e FAIL -O check
   count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1
   grep '^PASS: 1\.test 1 - mu$' stdout
   grep '^FAIL: 1\.test 2 zardoz$' stdout