On Saturday 26 November 2011, Stefano Lattarini wrote: > > Attached are the two patches I had promised. I'll wait 72 hours or your > ACK (whichever comes first) before pushing. > > Regards, > Stefano > Hmm... on a second thought, the check in txinfo21.test that sets `$have_correct_dir_timestamp' makes little sense -- it fails also on Linux, and *that's correct* in fact, because it's normal that a directory timestamp is not updated when a pre-existing file in it is touched! The timestamp should be updated if a new file is created in the directory, or if the directory is removed and re-created.
I propose to substitute the first patch with the attached one instead. Peter, if you have time, could you test if it works correctly on Cygwin? Thanks, and sorry for the noise, Stefano
From 91ab9c61fa4fe7451341f1434245a5cd92936162 Mon Sep 17 00:00:00 2001 Message-Id: <91ab9c61fa4fe7451341f1434245a5cd92936162.1322331015.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sat, 26 Nov 2011 14:35:58 +0100 Subject: [PATCH] tests: work around a Cygwin limitation in 'txinfo21.test' * tests/txinfo21.test: At least on Cygwin, the timestamp of a directory might not be properly updated when its contents are modified; we need to account for this behaviour. Also, since we are at it, remove a redundant `$sleep'. --- ChangeLog | 9 +++++++++ tests/txinfo21.test | 31 +++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8e6587..edb2f75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-11-26 Stefano Lattarini <stefano.lattar...@gmail.com> + Peter Rosin <p...@lysator.liu.se> + + tests: work around a Cygwin limitation in 'txinfo21.test' + * tests/txinfo21.test: At least on Cygwin, the timestamp of a + directory might not be properly updated when its contents are + modified; we need to account for this behaviour. Also, since + we are at it, remove a redundant `$sleep'. + 2011-11-24 Stefano Lattarini <stefano.lattar...@gmail.com> cosmetics: typofix in comments diff --git a/tests/txinfo21.test b/tests/txinfo21.test index ae1d985..e353a15 100755 --- a/tests/txinfo21.test +++ b/tests/txinfo21.test @@ -22,6 +22,20 @@ required='makeinfo-html tex texi2dvi' set -e +# At least on Cygwin, the timestamp of a directory might not be +# properly updated when the directory contents are changed, and +# we need to account for that in later checks. +mkdir tmp.d +: > tmp.f1 +$sleep +: > tmp.d/tmp.f2 +if is_newest tmp.d tmp.f1; then + have_correct_dir_timestamp=yes +else + have_correct_dir_timestamp=no +fi +rm -rf tmp.* + cat >>configure.in <<\EOF AC_CONFIG_FILES([rec/Makefile]) @@ -87,19 +101,28 @@ $AUTOCONF $MAKE -$sleep # Test production of split-per-node HTML. $MAKE html test -d main.html test -d sub/main2.html test -d rec/main3.html -# Rebuilding main.html should cause its timestamp to be updated. -is_newest main.html main.texi +# Rebuilding main.html should cause the timestamp of the regular +# file `main.html/index.html' to be updated. +is_newest main.html/index.html main.texi +# Rebuilding main.html should cause its timestamp to be updated +# (but main.html is a directory, so be prepared to account for the +# Cygwin limitation described above). +if test $have_correct_dir_timestamp = yes; then + is_newest main.html main.texi || Exit 1 +fi $sleep touch main.texi $MAKE html -is_newest main.html main.texi +is_newest main.html/index.html main.texi +if test $have_correct_dir_timestamp = yes; then + is_newest main.html main.texi || Exit 1 +fi $MAKE clean test ! -d main.html -- 1.7.2.3