tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / silent-lex.sh
old mode 100755 (executable)
new mode 100644 (file)
index 2838d6e..fdafe94
@@ -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
 
 # Check silent-rules mode for Lex.
 
-required=lex
-. ./defs || Exit 1
+required='cc lex'
+. test-init.sh
 
 mkdir sub
 
 cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
 AM_PROG_CC_C_O
 AC_PROG_LEX
 AC_CONFIG_FILES([sub/Makefile])
@@ -70,16 +69,15 @@ $AUTOMAKE --add-missing
 $AUTOCONF
 
 # Ensure per-target rules are used, to ensure their coverage below.
-$FGREP 'foo2-foo.c' Makefile.in || Exit 99
-$FGREP 'bar2-bar.c' sub/Makefile.in || Exit 99
+$FGREP 'foo2-foo.c' Makefile.in || exit 99
+$FGREP 'bar2-bar.c' sub/Makefile.in || exit 99
 
 ./configure --enable-silent-rules
 
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
+run_make -O
 
-$EGREP ' (-c|-o)' stdout && Exit 1
-$EGREP '(mv|ylwrap) ' stdout && Exit 1
+$EGREP ' (-c|-o)' stdout && exit 1
+$EGREP '(mv|ylwrap) ' stdout && exit 1
 
 grep 'LEX .*foo\.' stdout
 grep 'LEX .*bar\.' stdout
@@ -95,11 +93,10 @@ grep 'CCLD .*bar2' stdout
 # different set of rules.
 $MAKE clean
 
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
+run_make -O
 
-$EGREP ' (-c|-o)' stdout && Exit 1
-$EGREP '(mv|ylwrap) ' stdout && Exit 1
+$EGREP ' (-c|-o)' stdout && exit 1
+$EGREP '(mv|ylwrap) ' stdout && exit 1
 
 # Don't look for LEX, as probably lex hasn't been re-run.
 grep ' CC .*foo\.' stdout
@@ -113,27 +110,25 @@ grep 'CCLD .*bar2' stdout
 $MAKE clean
 rm -f *foo.c sub/*bar.c
 
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
-cat stdout
+run_make -O V=1
 
 grep ' -c ' stdout
 grep ' -o ' stdout
 grep 'ylwrap ' stdout
 
-$EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
+$EGREP '(LEX|CC|CCLD) ' stdout && exit 1
 
 # Cleaning and then rebuilding with the same V flag (and without
 # removing the generated sources in between) shouldn't trigger a
 # different set of rules.
 $MAKE clean
 
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
-cat stdout
+run_make -O V=1
 
 # Don't look for ylwrap, as probably lex hasn't been re-run.
 grep ' -c ' stdout
 grep ' -o ' stdout
 
-$EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
+$EGREP '(LEX|CC|CCLD) ' stdout && exit 1
 
 :