From: Stefano Lattarini Date: Sat, 7 Jul 2012 23:04:48 +0000 (+0200) Subject: [ng] tests: fix spurious failures on NetBSD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b9f22b79ce82b8e18f77468a80737921d76aaf5;p=thirdparty%2Fautomake.git [ng] tests: fix spurious failures on NetBSD * t/built-sources.sh (Makefile.am): In a recipe, use 'printf', not 'echo', to print a string containing a "\n" sequence, because that is interpreted like a newline by the echo built-in of NetBSD 5.1 /bin/ksh. * t/maken.sh: Don't expect the timestamp of the current directory to be unchanged after "make -n" is run in it; this doesn't hold on NetBSD 5.1. Instead, make the current directory unwritable before running "make -n", to ensure attempts to modify the directory fail. Signed-off-by: Stefano Lattarini --- diff --git a/t/built-sources.sh b/t/built-sources.sh index 902cee10d..b61b556bd 100755 --- a/t/built-sources.sh +++ b/t/built-sources.sh @@ -29,12 +29,14 @@ BUILT_SOURCES = foo.c noinst_PROGRAMS = bar baz foo.c: rm -f $@ $@-t - echo '#include ' > $@-t - echo 'int main (void)' >> $@-t - echo '{ ' >> $@-t - echo ' printf ("%s\n", FOOMSG);' >> $@-t - echo ' return 0;' >> $@-t - echo '}' >> $@-t + # Use printf, not echo, to avoid spurious interpretation of + # the "\n" as a newline (see on NetBSD 5.1). + printf '%s\n' '#include ' > $@-t + printf '%s\n' 'int main (void)' >> $@-t + printf '%s\n' '{ ' >> $@-t + printf '%s\n' ' printf ("%s\n", FOOMSG);' >> $@-t + printf '%s\n' ' return 0;' >> $@-t + printf '%s\n' '}' >> $@-t mv -f $@-t $@ CLEANFILES = foo.c END diff --git a/t/maken.sh b/t/maken.sh index ec992bf05..e4254e532 100755 --- a/t/maken.sh +++ b/t/maken.sh @@ -50,10 +50,12 @@ $AUTOMAKE for target in dist distcheck; do echo stamp > stampfile $sleep + chmod a-w . $MAKE -n $target $MAKE -n $target | grep stamp-sub-dist-hook + chmod u+w . # No file has been actually touched or created. - is_newest stampfile $(find .) + is_newest stampfile $(find . | grep -v '^\.$') $MAKE test-no-distdir done