test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / check12.sh
old mode 100755 (executable)
new mode 100644 (file)
index a21c6da..8ee308c
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-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
@@ -17,8 +17,9 @@
 # Test to make sure dejagnu tests, automake-style tests, and check-local
 # target can coexist.
 
+# For gen-testsuite-part: ==> try-with-serial-tests <==
 required=runtest
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
@@ -118,8 +119,8 @@ for vpath in : false; do
 
   if $vpath; then
     srcdir=..
-    mkdir build_
-    cd build_
+    mkdir build
+    cd build
   else
     srcdir=.
   fi
@@ -135,40 +136,38 @@ for vpath in : false; do
   test -f hammer.sum
   test -f spanner.log
   test -f spanner.sum
-  # This checks will be run only by the autogenerated 'check12-p.test'.
-  if test x"$am_parallel_tests" = x"yes"; then
+  if test x"$am_serial_tests" != x"yes"; then
     test -f test-suite.log
     test -f a.log
     test -f b.log
-  else :; fi
+  fi
   grep 'check-local succeeded :-)' local.log
 
   cp -f config.status config-status.sav
 
   $MAKE distclean
-  test ! -r hammer.log
-  test ! -r hammer.sum
-  test ! -r spanner.log
-  test ! -r spanner.sum
-  test ! -r test-suite.log
-  test ! -r a.log
-  test ! -r b.log
-  test ! -r local.log
+  test ! -e hammer.log
+  test ! -e hammer.sum
+  test ! -e spanner.log
+  test ! -e spanner.sum
+  test ! -e test-suite.log
+  test ! -e a.log
+  test ! -e b.log
+  test ! -e local.log
 
   mv -f config-status.sav config.status
   ./config.status
 
-  NAIL=screw $MAKE check && Exit 1
+  NAIL=screw $MAKE check && exit 1
   test -f hammer.log
   test -f hammer.sum
   test -f spanner.log
   test -f spanner.sum
   grep 'FAIL: test_hammer' hammer.sum
-  grep 'FAIL:' spanner.sum && Exit 1
+  grep 'FAIL:' spanner.sum && exit 1
 
-  B_EXIT_STATUS=1 $MAKE check && Exit 1
-  # This checks will be run only by the autogenerated 'check12-p.test'.
-  if test x"$am_parallel_tests" = x"yes"; then
+  B_EXIT_STATUS=1 $MAKE check && exit 1
+  if test x"$am_serial_tests" != x"yes"; then
     cat test-suite.log
     cat a.log
     cat b.log
@@ -176,11 +175,11 @@ for vpath in : false; do
     grep '^b\.test: exit status: 1$' b.log
     grep '^FAIL: b$' test-suite.log
     grep '^b\.test: exit status: 1$' test-suite.log
-    grep '^a\.test' test-suite.log && Exit 1
+    grep '^a\.test' test-suite.log && exit 1
     : For shells with busted 'set -e'.
-  else :; fi
+  fi
 
-  CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
+  CHECKLOCAL_EXIT_STATUS=1 $MAKE check && exit 1
   grep 'check-local failed :-(' local.log
 
   # Do not trust the exit status of 'make -k'.
@@ -190,9 +189,8 @@ for vpath in : false; do
   test -f spanner.log
   test -f spanner.sum
   grep 'FAIL: test_hammer' hammer.sum
-  grep 'FAIL:' spanner.sum && Exit 1
-  # This checks will be run only by the autogenerated 'check12-p.test'.
-  if test x"$am_parallel_tests" = x"yes"; then
+  grep 'FAIL:' spanner.sum && exit 1
+  if test x"$am_serial_tests" != x"yes"; then
     cat test-suite.log
     cat a.log
     cat b.log
@@ -200,9 +198,9 @@ for vpath in : false; do
     grep '^b\.test: exit status: 23$' b.log
     grep '^FAIL: b$' test-suite.log
     grep '^b\.test: exit status: 23$' test-suite.log
-    grep '^a\.test' test-suite.log && Exit 1
+    grep '^a\.test' test-suite.log && exit 1
     : For shells with busted 'set -e'.
-  else :; fi
+  fi
   grep 'check-local failed :-(' local.log
 
   cd $srcdir