[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH] [ng] tests: fix spurious failures on NetBSD
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH] [ng] tests: fix spurious failures on NetBSD |
Date: |
Sun, 8 Jul 2012 01:05:51 +0200 |
* 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 og 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 that doesn't try to write anything in it.
Signed-off-by: Stefano Lattarini <address@hidden>
---
Will push this tomorrow morning.
Regards,
Stefano
t/built-sources.sh | 14 ++++++++------
t/maken.sh | 4 +++-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/t/built-sources.sh b/t/built-sources.sh
index 902cee1..b61b556 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 $@ address@hidden
- echo '#include <stdio.h>' > address@hidden
- echo 'int main (void)' >> address@hidden
- echo '{ ' >> address@hidden
- echo ' printf ("%s\n", FOOMSG);' >> address@hidden
- echo ' return 0;' >> address@hidden
- echo '}' >> address@hidden
+ # Use printf, not echo, to avoid spurious interpretation of
+ # the "\n" as a newline (see on NetBSD 5.1).
+ printf '%s\n' '#include <stdio.h>' > address@hidden
+ printf '%s\n' 'int main (void)' >> address@hidden
+ printf '%s\n' '{ ' >> address@hidden
+ printf '%s\n' ' printf ("%s\n", FOOMSG);' >> address@hidden
+ printf '%s\n' ' return 0;' >> address@hidden
+ printf '%s\n' '}' >> address@hidden
mv -f address@hidden $@
CLEANFILES = foo.c
END
diff --git a/t/maken.sh b/t/maken.sh
index ec992bf..e4254e5 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
--
1.7.9.5
- [Automake-NG] [PATCH] [ng] tests: fix spurious failures on NetBSD,
Stefano Lattarini <=