tests: fix spurious failure of extradep.test on FreeBSD
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 7 May 2011 10:58:51 +0000 (12:58 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 7 May 2011 13:06:15 +0000 (15:06 +0200)
* tests/extradep.test: When using `ls -t' to determine whether a
file has been updated, make sure to use as reference a file whose
timestamp is expected to be *strictly* older that that of the file
being checked.  This is required because at least FreeBSD `ls' do
not sort files with the same timestamp in alphabetical order when
using the `-t' option.
* tests/extradep2.test: Likewise.

ChangeLog
tests/extradep.test
tests/extradep2.test

index 356a9fc..614dcd7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-05-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: fix spurious failure of extradep.test on FreeBSD
+       * tests/extradep.test: When using `ls -t' to determine whether a
+       file has been updated, make sure to use as reference a file whose
+       timestamp is expected to be *strictly* older that that of the file
+       being checked.  This is required because at least FreeBSD ls do
+       not sort files with the same timestamp in alphabetical order when
+       using the `-t' option.
+       * tests/extradep2.test: Likewise.
+
 2010-10-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Implement EXTRA_maude_DEPENDENCIES for programs and libraries.
index d84182d..64385f1 100755 (executable)
@@ -46,8 +46,10 @@ EXTRA_bar_DEPENDENCIES = $(deps)
 
 EXTRA_DIST = foodep bardep
 
-bar-is-newer-than-libfoo.a:
-       test `ls -1t bar$(EXEEXT) libfoo.a | sed q` = bar$(EXEEXT)
+.PHONY: bar-has-been-updated
+bar-has-been-updated:
+       stat older bar$(EXEEXT) libfoo.a || : For debugging.
+       test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
 END
 
 cat >libfoo.c <<'END'
@@ -94,10 +96,11 @@ $MAKE && Exit 1
 : >bardep
 
 $MAKE
+: > older
 $sleep
 touch libfoo.a
 $MAKE
-$MAKE bar-is-newer-than-libfoo.a
+$MAKE bar-has-been-updated
 
 $MAKE distcheck
 
index 7d72e82..210dddf 100755 (executable)
@@ -42,8 +42,10 @@ EXTRA_bar_DEPENDENCIES = $(deps)
 
 EXTRA_DIST = bardep
 
-bar-is-newer-than-libfoo.la:
-       test `ls -1t bar$(EXEEXT) libfoo.la | sed q` = bar$(EXEEXT)
+.PHONY: bar-has-been-updated
+bar-has-been-updated:
+       stat older bar$(EXEEXT) libfoo.la || : For debugging.
+       test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
 END
 
 cat >libfoo.c <<'END'
@@ -76,10 +78,11 @@ $MAKE && Exit 1
 : >bardep
 
 $MAKE
+: > older
 $sleep
 touch libfoo.la
 $MAKE
-$MAKE bar-is-newer-than-libfoo.la
+$MAKE bar-has-been-updated
 
 $MAKE distcheck