[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10] Fix parallel-tests with empty $(TESTS) for BSD make.
From: |
Ralf Wildenhues |
Subject: |
[PATCH 10] Fix parallel-tests with empty $(TESTS) for BSD make. |
Date: |
Sat, 14 Mar 2009 11:59:56 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
TESTS=
TEST_LOGS=$(TESTS:=.log)
would otherwise barf with an error that the file `.log' could not be
remade. Since this file name also looks like a single suffix rule,
there is no way to portably write a rule to ignore it. So in this case
we have to overwrite TESTS.
Cheers,
Ralf
Fix parallel-tests with empty $(TESTS) for BSD make.
* lib/am/check.am [PARALLEL_TESTS] ($(TEST_SUITE_LOG)): Ignore
empty line stemming from empty $(TEST_LOGS), to avoid counting
zero tests as one.
(check-TESTS): If `$(TESTS)' is empty, override TEST_LOGS to be
empty, rather than `.log', for BSD make.
* tests/parallel-tests6.test: New test.
* tests/Makefile.am: Update.
diff --git a/lib/am/check.am b/lib/am/check.am
index 9a3c256..5a2de7d 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -145,7 +145,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
results=`for f in $$list; do \
read line < $$f && echo "$$line" || echo FAIL; \
done`; \
- all=`echo "$$results" | wc -l | sed -e 's/^[ ]*//'`; \
+ all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[
]*//'`; \
fail=`echo "$$results" | grep -c '^FAIL'`; \
pass=`echo "$$results" | grep -c '^PASS'`; \
skip=`echo "$$results" | grep -c '^SKIP'`; \
@@ -223,7 +223,10 @@ check-TESTS:
&& test -n "$(TEST_SUITE_LOG)$(TEST_LOGS)"; then \
rm -f $(TEST_SUITE_LOG) $(TEST_LOGS); \
fi
- @$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG)
+ @set_logs=; if test "X$(TEST_LOGS)" = X.log; then \
+ set_logs=TEST_LOGS=; \
+ fi; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) $$set_logs
.MAKE: check-TESTS
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2504941..e0b7f23 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -485,6 +485,7 @@ parallel-tests2.test \
parallel-tests3.test \
parallel-tests4.test \
parallel-tests5.test \
+parallel-tests6.test \
parse.test \
percent.test \
percent2.test \
diff --git a/tests/parallel-tests6.test b/tests/parallel-tests6.test
new file mode 100755
index 0000000..59a0b0e
--- /dev/null
+++ b/tests/parallel-tests6.test
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check parallel-tests features:
+# - empty TESTS
+# BSD make will expand `$(TESTS:=.log)' to `.log' unless overridden.
+
+. ./defs-p || Exit 1
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS =
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+unset TESTS || :
+
+./configure
+$MAKE check >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '0 tests' stdout
+
+Exit 0
- [PATCH 03] New tests for `parallel-tests'., (continued)
- [PATCH 03] New tests for `parallel-tests'., Ralf Wildenhues, 2009/03/14
- Re: [PATCH 04] Documentation for the parallel-tests driver., Ralf Wildenhues, 2009/03/14
- Re: [PATCH 05] Overhaul of tests/README., Ralf Wildenhues, 2009/03/14
- Re: [PATCH 06] parallel-tests: Fix summary output., Ralf Wildenhues, 2009/03/14
- [PATCH 07] Use append mode to capture parallel test output., Ralf Wildenhues, 2009/03/14
- [PATCH 08] Match XFAIL_TESTS correctly with Solaris make., Ralf Wildenhues, 2009/03/14
- [PATCH 09] Mark check-html and check-TESTS as recursive for BSD make., Ralf Wildenhues, 2009/03/14
- [PATCH 10] Fix parallel-tests with empty $(TESTS) for BSD make.,
Ralf Wildenhues <=
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Ralf Wildenhues, 2009/03/14
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Akim Demaille, 2009/03/14
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Akim Demaille, 2009/03/14
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Ralf Wildenhues, 2009/03/14
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Akim Demaille, 2009/03/14
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Ralf Wildenhues, 2009/03/17
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Akim Demaille, 2009/03/18
- Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation., Ralf Wildenhues, 2009/03/19
- parallel-tests: warn about $(srcdir), $(top_srcdir) in TESTS., Ralf Wildenhues, 2009/03/28
- Re: parallel-tests: warn about $(srcdir), $(top_srcdir) in TESTS., Akim Demaille, 2009/03/30