tests: expose automake bug#14560
[platform/upstream/automake.git] / t / subobj-clean-lt-pr10697.sh
old mode 100755 (executable)
new mode 100644 (file)
index cfebc99..ddcd112
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -22,7 +22,7 @@
 # 'subobj-clean-pr10697.sh', which deals with the non-libtool case.
 
 required='cc libtoolize'
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
@@ -33,18 +33,16 @@ AC_OUTPUT
 END
 
 oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 # An rm(1) wrapper that fails when invoked too many times.
 mkdir rm-wrap
 max_rm_invocations=6
 count_file=$ocwd/rm-wrap/count
 cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+if ! test \$count -le $max_rm_invocations; then
   echo "rm invoked more than $max_rm_invocations times" >&2
   exit 1
 fi
@@ -119,10 +117,10 @@ $MAKE mostlyclean
 ls -l . sub1 sub2
 for i in 1 2; do
   for j in a b c d e f; do
-    test ! -f sub$i/$j.o
-    test ! -f sub$i/$j.obj
-    test ! -f sub$i/$j.lo
-    test -f sub$i/$j.c || Exit 99 # Sanity check
+    test ! -e sub$i/$j.o
+    test ! -e sub$i/$j.obj
+    test ! -e sub$i/$j.lo
+    test -f sub$i/$j.c || exit 99 # Sanity check
   done
 done
 
@@ -155,14 +153,14 @@ test -f sub2/a.$OBJEXT
 
 # ... but they get removed by "make mostlyclean" ...
 $MAKE mostlyclean
-test ! -f sub1/a.$OBJEXT
-test ! -f sub2/d.$OBJEXT
+test ! -e sub1/a.$OBJEXT
+test ! -e sub2/d.$OBJEXT
 
 # ... and do not get rebuilt ...
 $MAKE clean
 $MAKE all
-test ! -f sub1/a.$OBJEXT
-test ! -f sub2/d.$OBJEXT
+test ! -e sub1/a.$OBJEXT
+test ! -e sub2/d.$OBJEXT
 
 # ... while the non-stale files do.
 test -f sub1/b.$OBJEXT