tests: expose automake bug#14560
[platform/upstream/automake.git] / t / lex-depend-cxx.sh
old mode 100755 (executable)
new mode 100644 (file)
index 490516f..7286e39
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-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,8 @@
 # Test to make sure dependencies work with Lex/C++.
 # Test synthesized from PR automake/6.
 
-required=lex
-. ./defs || Exit 1
+required='c++ lex'
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
@@ -40,9 +40,8 @@ test-deps-exist:
 
 .PHONY: test-obj-updated
 test-obj-updated: joe.$(OBJEXT) moe.$(OBJEXT)
-       stat older my-hdr.hxx joe.$(OBJEXT) moe.$(OBJEXT) || :
-       test `ls -t older joe.$(OBJEXT) | sed 1q` = joe.$(OBJEXT)
-       test `ls -t older moe.$(OBJEXT) | sed 1q` = moe.$(OBJEXT)
+       is_newest joe.$(OBJEXT) my-hdr.hxx
+       is_newest moe.$(OBJEXT) my-hdr.hxx
 END
 
 cat > joe.ll << 'END'
@@ -61,7 +60,6 @@ int yywrap (void)
 }
 int main (int argc, char **argv)
 {
-  printf("Hello, World!\n");
   return 0;
 }
 END
@@ -69,8 +67,7 @@ END
 cp joe.ll moe.l++
 
 cat > my-hdr.hxx <<'END'
-// This header contains deliberetly invalid C (but valid C++)
-#include <cstdio>
+// This header contains deliberately invalid C (but valid C++).
 using namespace std;
 END
 
@@ -88,7 +85,6 @@ $AUTOCONF
 $MAKE test-deps-exist
 $MAKE
 
-: > older
 $sleep
 touch my-hdr.hxx
 $MAKE test-obj-updated