tests: expose automake bug#14560
[platform/upstream/automake.git] / t / subdir-order.sh
index 0321c25..6e25e52 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-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
@@ -16,7 +16,7 @@
 
 # The $(SUDBIRS) entries are processed in the order they are specified.
 
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([
@@ -124,6 +124,17 @@ all-local:
        : > run
 END
 
+echo dummy: > Makefile
+if using_gmake; then
+  jobs=-j12
+elif $MAKE -j12; then
+  jobs=-j12
+elif $MAKE -j 12; then
+  jobs="-j 12"
+else
+  jobs=none
+fi
+rm -f Makefile
 
 $ACLOCAL
 $AUTOCONF
@@ -131,7 +142,8 @@ $AUTOMAKE -c --add-missing
 
 ./configure
 
-for j in '' -j12; do
+for j in '' "$jobs"; do
+  test x"$j" = x"none" && continue
   $MAKE $j
   test -f run
   test -f sub0/run
@@ -140,7 +152,7 @@ for j in '' -j12; do
   test -f sub3/a/run
   test -f sub3/b/run
   $MAKE clean
-  find . | grep 'run$' && Exit 1
+  find . | grep 'run$' && exit 1
   : # For shells with busted 'set -e'
 done