]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix bug in test `backcompat6.test' (MSYS portability).
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 12 Nov 2010 19:35:35 +0000 (20:35 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 13 Nov 2010 12:41:23 +0000 (13:41 +0100)
* tests/backcompat6.test (Makefile.am): Grep the output from the
test program, rather than diffing it, to avoid spurious failures
on MinGW/MSYS due to LF vs. CRLF line endings.

Reported by Ralf Wildenhues.

ChangeLog
tests/backcompat6.test

index 5bc575b780434aa3c12e3098214685eb1b27b6ac..bf2e61761be78b6a150fc3c64583a3d08a3cf8aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix bug in test `backcompat6.test' (MSYS portability).
+       * tests/backcompat6.test (Makefile.am): Grep the output from the
+       test program, rather than diffing it, to avoid spurious failures
+       on MinGW/MSYS due to LF vs. CRLF line endings.
+       Reported by Ralf Wildenhues.
+
 2010-11-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix bug in test `backcompat4.test' (stale autom4te cache).
index 534ecb1b7199c23e720ad75ed66e11b934622746..0d63bcc9acae79d433597957e8fade93cc9ba680 100755 (executable)
@@ -53,19 +53,15 @@ END
 cat >> Makefile.am <<'END'
 bin_PROGRAMS = foo
 foo_SOURCES = quux.c
-DISTCLEANFILES = *.tmp
 check-local:
-       rm -f exp got
-       echo 'PACKAGE = nonesuch-zardoz' > exp.tmp
-       echo 'VERSION = nonesuch-0.1' >> exp.tmp
-       echo 'PACKAGE = $(PACKAGE)' > got1.tmp
-       echo 'VERSION = $(VERSION)' >> got1.tmp
-       ./foo > got2.tmp
-       cat exp.tmp
-       cat got1.tmp
-       cat got2.tmp
-       diff exp.tmp got1.tmp
-       diff exp.tmp got2.tmp
+       test x'$(PACKAGE)' = x'nonesuch-zardoz'
+       test x'$(VERSION)' = x'nonesuch-0.1'
+       ./foo # for debugging
+       ## Do not anchor the regexps w.r.t. the end of line, because on
+       ## MinGW/MSYS, grep may assume LF line endings only, while our
+       ## `foo' program may generate CRLF line endings.
+       ./foo | grep '^PACKAGE = nonesuch-zardoz!'
+       ./foo | echo '^VERSION = nonesuch-0\.1!'
 END
 
 cat > quux.c <<'END'
@@ -73,7 +69,7 @@ cat > quux.c <<'END'
 #include <stdio.h>
 int main (void)
 {
-  printf("PACKAGE = %s\nVERSION = %s\n", PACKAGE, VERSION);
+  printf("PACKAGE = %s!\nVERSION = %s!\n", PACKAGE, VERSION);
   return 0;
 }
 END