From: Stefano Lattarini Date: Sat, 7 May 2011 10:58:51 +0000 (+0200) Subject: tests: fix spurious failure of extradep.test on FreeBSD X-Git-Tag: ng-0.5a~181^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c92ac83b1329e8e2c24ff25974993cb4d520c2e3;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 356a9fc0d..614dcd796 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-05-07 Stefano Lattarini + + 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 Implement EXTRA_maude_DEPENDENCIES for programs and libraries. diff --git a/tests/extradep.test b/tests/extradep.test index d84182d8f..64385f19b 100755 --- a/tests/extradep.test +++ b/tests/extradep.test @@ -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 diff --git a/tests/extradep2.test b/tests/extradep2.test index 7d72e8222..210dddf6e 100755 --- a/tests/extradep2.test +++ b/tests/extradep2.test @@ -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