[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-ng] [PATCH 10/10] [ng] tests: fix a spurious failure on Solari
From: |
Stefano Lattarini |
Subject: |
[Automake-ng] [PATCH 10/10] [ng] tests: fix a spurious failure on Solaris 10 |
Date: |
Mon, 23 Apr 2012 11:57:28 +0200 |
* t/parallel-tests-unreadable.sh: On Solaris 10, on an error due to missing
read permission, 'cat' reports simply "cat: cannot open FILENAME", rather
than a proper "Permission denied" message; similarly fr grep. Adjust the
test (and comments) to cater for that.
Signed-off-by: Stefano Lattarini <address@hidden>
---
t/parallel-tests-unreadable.sh | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/t/parallel-tests-unreadable.sh b/t/parallel-tests-unreadable.sh
index a3380c3..02b711d 100755
--- a/t/parallel-tests-unreadable.sh
+++ b/t/parallel-tests-unreadable.sh
@@ -60,31 +60,44 @@ doit ()
cat stderr >&2
}
-permission_denied ()
+could_not_read ()
{
- # FIXME: there are systems where errors on permissions generate a
- # FIXME: different message? We might experience spurious failures
- # FIXME: there ...
- grep "$1:.*[pP]ermission denied" stderr
+ # We have to settle for weak checks to avoid spurious failures due to
+ # the differences in error massages on different systems; for example:
+ #
+ # $ cat unreadable-file # GNU/Linux or NetBSD
+ # cat: unreadable-file: Permission denied
+ # $ cat unreadable-file # Solaris 10
+ # cat: cannot open unreadable
+ #
+ # $ grep foo unreadable-file # GNU/Linux and NetBSD
+ # grep: unreadable: Permission denied
+ # $ grep foo unreadable-file # Solaris 10
+ # grep: can't open "unreadable"
+ #
+ # FIXME: this might still needs adjustments on other systems ...
+ #
+ grep "$1:.*[pP]ermission denied" stderr \
+ || $EGREP "can(no|')t open [\"'\`]?$1" stderr
}
for lst in bar.log 'foo.log bar.log'; do
doit $lst
- permission_denied bar.log
+ could_not_read bar.log
grep 'test-suite\.log:.* I/O error reading test logs' stderr
done
doit foo.trs
-permission_denied foo.trs
+could_not_read foo.trs
grep 'test-suite\.log:.* I/O error reading test results' stderr
doit foo.trs bar.trs
-permission_denied foo.trs
-permission_denied bar.trs
+could_not_read foo.trs
+could_not_read bar.trs
grep 'test-suite\.log:.* I/O error reading test results' stderr
doit foo.trs bar.log
-permission_denied foo.trs
+could_not_read foo.trs
grep 'test-suite\.log:.* I/O error reading test results' stderr
:
--
1.7.9.5
- [Automake-ng] [PATCH 00/10] Rewrite parallel-tests to rely on GNU make capabilities, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 02/10] [ng] cleanup: simplify %transforms for parallel-tests handling, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 05/10] [ng] parallel-tests: support "TESTS = $(srcdir)/foo.test", Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 04/10] [ng] coverage: parallel-tests and dynamic $(TESTS) content, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 01/10] [ng] parallel-tests: simplify, using pattern rules with multiple targets, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 03/10] [ng] parallel-tests: simplify automake-time preprocessing, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 07/10] [ng] tests: run long-running ones early (useful with parallel make), Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 06/10] [ng] build: define $(TESTS) through a wildcard, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 08/10] [ng] parallel-tests: remove obsolete comment, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 09/10] [ng] parallel-tests: fix confusing function names in Makefile recipes, Stefano Lattarini, 2012/04/23
- [Automake-ng] [PATCH 10/10] [ng] tests: fix a spurious failure on Solaris 10,
Stefano Lattarini <=
- Re: [Automake-ng] [PATCH 00/10] Rewrite parallel-tests to rely on GNU make capabilities, Stefano Lattarini, 2012/04/26