automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {maint} tests: relax a test on amhello examples to cater to Solari


From: Stefano Lattarini
Subject: [FYI] {maint} tests: relax a test on amhello examples to cater to Solaris tar
Date: Sat, 23 Jul 2011 15:11:56 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* 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                 |   11 +++++++++++
 tests/amhello-binpkg.test |   13 ++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 888e95b..76df2f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-07-23  Stefano Lattarini  <address@hidden>
+
+       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  <address@hidden>
 
        tests: portability fixes in tests on amhello examples
diff --git a/tests/amhello-binpkg.test b/tests/amhello-binpkg.test
index 34600fe..34dc519 100755
--- a/tests/amhello-binpkg.test
+++ b/tests/amhello-binpkg.test
@@ -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
 
 :
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]