[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 7/6] [ng] check: in recipes, don't use pipe when re
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 7/6] [ng] check: in recipes, don't use pipe when redirection suffices |
Date: |
Sun, 22 Jul 2012 11:44:48 +0200 |
Instead of the botched idiom:
while read c; do echo $c; done <file | command
use the simpler and much better one:
command <file
Not only the latter is simpler and marginally more efficient, but is also
better at catching possible unexpected I/O errors; while in the former,
the exit status of the while loop (which might have revealed such errors)
was lost in the pipeline.
* lib/am/parallel-tests.am ($(TEST_SUITE_LOG), recheck): Use the better
idiom.
Co-authored-by: Akim Demaille <address@hidden>
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/am/parallel-tests.am | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am
index 048cdfa..218fcd9 100644
--- a/lib/am/parallel-tests.am
+++ b/lib/am/parallel-tests.am
@@ -406,8 +406,7 @@ $(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
- while read b; do echo $$b; done <$$workdir/bases \
- | $(am__create_global_log); \
+ $(am__create_global_log) <$$workdir/bases \
} >$(TEST_SUITE_LOG).tmp; then \
mv -f $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
else \
@@ -471,9 +470,8 @@ recheck: all %CHECK_DEPS%
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
## If running a "make recheck", we must only consider tests that had an
## unexpected outcome (FAIL or XPASS) in the earlier run.
- @bases=`while read b; do echo $$b; done \
- <$(am.test-harness.workdir)/bases \
- | $(am__list_recheck_tests)` || exit 1; \
+ @bases=`$(am__list_recheck_tests) \
+ <$(am.test-harness.workdir)/bases` || exit 1; \
## Remove newlines and normalize whitespace.
bases=`echo $$bases`; \
## Re-run the relevant tests, without hitting command-line length limits.
--
1.7.10.4
- Re: [Automake-NG] [PATCH 2/6] [ng] parallel-tests: do not exceed command line length limits, (continued)
- [Automake-NG] [PATCH 3/6] [ng] check: use awk rather than grep+xargs to count test results, Stefano Lattarini, 2012/07/21
- [Automake-NG] [PATCH 4/6] [ng] check: refactor for less duplication and better performances, Stefano Lattarini, 2012/07/21
- [Automake-NG] [PATCH 5/6] [ng] coverage: recheck with many failed tests, Stefano Lattarini, 2012/07/21
- [Automake-NG] [PATCH 6/6] [ng] recheck: don't exceed command line limits, even with many failed tests, Stefano Lattarini, 2012/07/21
- [Automake-NG] [PATCH 7/6] [ng] check: in recipes, don't use pipe when redirection suffices,
Stefano Lattarini <=
- Re: [Automake-NG] [PATCH 0/6] Run many tests without hitting command line length limits, Stefano Lattarini, 2012/07/23