2009-03-10 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ 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.
+
Mark check-html and check-TESTS as recursive for BSD make.
* lib/am/check.am [PARALLEL_TESTS] (.MAKE): Add check-TESTS
and check-html prerequisites.
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'`; \
&& 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
parallel-tests3.test \
parallel-tests4.test \
parallel-tests5.test \
+parallel-tests6.test \
parse.test \
percent.test \
percent2.test \
parallel-tests3.test \
parallel-tests4.test \
parallel-tests5.test \
+parallel-tests6.test \
parse.test \
percent.test \
percent2.test \
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'`; \
&& 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
.log.html:
@list='$(RST2HTML) $$RST2HTML rst2html rst2html.py'; \
--- /dev/null
+#! /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