From: Stefano Lattarini Date: Sat, 4 Aug 2012 18:38:31 +0000 (+0200) Subject: tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana X-Git-Tag: v1.12.3~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f989c7e173a925e0dbe879afafa9db23fd12a974;p=thirdparty%2Fautomake.git tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana * t/vala-vapi.sh: Use 'printf', not 'echo', to print strings containing substrings like '\n', that can be interpreted like escape strings. That because the /bin/sh and the /bin/bash shell from OpenIndiana actually interpret them that way: $ /bin/sh -c 'echo "foo\nbar"' foo bar $ /bin/bash -c 'echo "foo\nbar"' foo bar Signed-off-by: Stefano Lattarini --- diff --git a/t/vala-vapi.sh b/t/vala-vapi.sh index 1862b71bc..2f332da6f 100755 --- a/t/vala-vapi.sh +++ b/t/vala-vapi.sh @@ -40,7 +40,9 @@ int main () } END -echo '#define BARBAR "Zardoz!\n"' > foo.h +# Use printf, not echo, to avoid '\n' being considered and escape +# sequence and printed as a newline in 'foo.h'. +printf '%s\n' '#define BARBAR "Zardoz!\n"' > foo.h cat > foo.vapi <<'END' [CCode (cprefix="", lower_case_cprefix="", cheader_filename="foo.h")] @@ -74,7 +76,9 @@ cross_compiling || $MAKE test1 || exit 1 # Simple check on remake rules. $sleep -echo '#define BAZBAZ "Quux!\n"' > foo.h +# Use printf, not echo, to avoid '\n' being considered and escape +# sequence and printed as a newline in 'foo.h'. +printf '%s\n' '#define BAZBAZ "Quux!\n"' > foo.h sed 's/BARBAR/BAZBAZ/' zardoz.vala > t && mv -f t zardoz.vala || exit 99 $MAKE && exit 1 sed 's/BARBAR/BAZBAZ/' foo.vapi > t && mv -f t foo.vapi || exit 99