tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / yacc-depend2.sh
old mode 100755 (executable)
new mode 100644 (file)
index 879cc59..3fed4e1
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-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
@@ -18,8 +18,8 @@
 # for yacc rules.  This test still fails with FreeBSD make (but passes
 # with NetBSD make).
 
-required=yacc
-. ./defs || Exit 1
+required='cc yacc'
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -32,14 +32,11 @@ bin_PROGRAMS = foo
 AM_YFLAGS = -d
 foo_SOURCES = foo.y main.c
 BUILT_SOURCES = foo.h
-.PHONY: debug-info test-time-unchanged test-time-changed
-debug-info:
-       ls -l
-       stat *.[ch] *.$(OBJEXT) my-timestamp || :
-test-time-unchanged: debug-info
-       test `ls -1t main.$(OBJEXT) my-timestamp | sed 1q` = my-timestamp
-test-time-changed: debug-info
-       test `ls -1t main.$(OBJEXT) my-timestamp | sed 1q` = main.$(OBJEXT)
+.PHONY: test-time-unchanged test-time-changed
+test-time-unchanged:
+       is_newest foo.y foo.h main.$(OBJEXT)
+test-time-changed:
+       is_newest main.$(OBJEXT) foo.y foo.h
 END
 
 cat > foo.y << 'END'
@@ -72,8 +69,6 @@ $MAKE
 ls -l # For debugging.
 
 $sleep
-: > my-timestamp
-$sleep
 touch foo.y
 $MAKE
 $MAKE test-time-unchanged