]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: relax a test on amhello examples to cater to Solaris tar
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 23 Jul 2011 13:09:23 +0000 (15:09 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 23 Jul 2011 13:09:23 +0000 (15:09 +0200)
* tests/amhello-binpkg.test: When the tar implementation in use
is not GNU tar, relax the tests on tar output, to avoid spurious
failures.  For example, "tar cvf ..." with GNU tar can output
lines like "./usr/bin/hello" on the standard output, while with
Solaris tar it can output lines like "a ./usr/bin/hello 8K" on
standard output, and with Heirloom tar it can output lines like
"a ./usr/bin/hello 15 tape blocks" on standard error.

ChangeLog
tests/amhello-binpkg.test

index 888e95b5086dbfc868f4e202540e7876c3b341f1..76df2f25ae18cf4d55b71704bd3bf0cc1730505e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-07-23  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: relax a test on amhello examples to cater to Solaris tar
+       * tests/amhello-binpkg.test: When the tar implementation in use
+       is not GNU tar, relax the tests on tar output, to avoid spurious
+       failures.  For example, "tar cvf ..." with GNU tar can output
+       lines like "./usr/bin/hello" on the standard output, while with
+       Solaris tar it can output lines like "a ./usr/bin/hello 8K" on
+       standard output, and with Heirloom tar it can output lines like
+       "a ./usr/bin/hello 15 tape blocks" on standard error.
+
 2011-07-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: portability fixes in tests on amhello examples
index 34600fe7e581326e3f2cd1e37ad03f2ef170eee5..34dc5194e3ded81710996e61374d3e256bfe230f 100755 (executable)
@@ -32,12 +32,19 @@ make
 make DESTDIR="`pwd`/inst" install
 cd inst
 find . -type f -print > ../files.lst
-tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > t
-LC_ALL=C sort t > tar.got
+tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > tar.got 2>&1
 
-diff - tar.got <<'END'
+if tar --version </dev/null | grep GNU; then
+  LC_ALL=C sort tar.got > t
+  mv -f t tar.got
+  diff - tar.got <<'END'
 ./usr/bin/hello
 ./usr/share/doc/amhello/README
 END
+else
+  : Be laxer with other tar implementations, to avoid spurious failures.
+  $EGREP '(^| )\./usr/bin/hello( |$)' tar.got
+  $EGREP '(^| )\./usr/share/doc/amhello/README( |$)' tar.got
+fi
 
 :