$output_rules .= 'check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; \\
srcdir=$(srcdir); export srcdir; \\
- for tst in $(TESTS); do \\
- if test -f ./$$tst; then dir=./; \\
- elif test -f $$tst; then dir=; \\
- else dir="$(srcdir)/"; fi; \\
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \\
- all=`expr $$all + 1`; \\
- case " $(XFAIL_TESTS) " in \\
- *" $$tst "*) \\
- xpass=`expr $$xpass + 1`; \\
- failed=`expr $$failed + 1`; \\
- echo "XPASS: $$tst"; \\
- ;; \\
- *) \\
- echo "PASS: $$tst"; \\
- ;; \\
- esac; \\
- elif test $$? -ne 77; then \\
- all=`expr $$all + 1`; \\
- case " $(XFAIL_TESTS) " in \\
- *" $$tst "*) \\
- xfail=`expr $$xfail + 1`; \\
- echo "XFAIL: $$tst"; \\
- ;; \\
- *) \\
- failed=`expr $$failed + 1`; \\
- echo "FAIL: $$tst"; \\
- ;; \\
- esac; \\
- fi; \\
- done; \\
- if test "$$failed" -eq 0; then \\
- if test "$$xfail" -eq 0; then \\
- banner="All $$all tests passed"; \\
- else \\
- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \\
- fi; \\
- else \\
- if test "$$xpass" -eq 0; then \\
- banner="$$failed of $$all tests failed"; \\
+ list=' . "'\$(TESTS)'; \\" . '
+ if test -n "$$list"; then \\
+ for tst in $$list; do \\
+ if test -f ./$$tst; then dir=./; \\
+ elif test -f $$tst; then dir=; \\
+ else dir="$(srcdir)/"; fi; \\
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \\
+ all=`expr $$all + 1`; \\
+ case " $(XFAIL_TESTS) " in \\
+ *" $$tst "*) \\
+ xpass=`expr $$xpass + 1`; \\
+ failed=`expr $$failed + 1`; \\
+ echo "XPASS: $$tst"; \\
+ ;; \\
+ *) \\
+ echo "PASS: $$tst"; \\
+ ;; \\
+ esac; \\
+ elif test $$? -ne 77; then \\
+ all=`expr $$all + 1`; \\
+ case " $(XFAIL_TESTS) " in \\
+ *" $$tst "*) \\
+ xfail=`expr $$xfail + 1`; \\
+ echo "XFAIL: $$tst"; \\
+ ;; \\
+ *) \\
+ failed=`expr $$failed + 1`; \\
+ echo "FAIL: $$tst"; \\
+ ;; \\
+ esac; \\
+ fi; \\
+ done; \\
+ if test "$$failed" -eq 0; then \\
+ if test "$$xfail" -eq 0; then \\
+ banner="All $$all tests passed"; \\
+ else \\
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \\
+ fi; \\
else \\
- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \\
+ if test "$$xpass" -eq 0; then \\
+ banner="$$failed of $$all tests failed"; \\
+ else \\
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \\
+ fi; \\
fi; \\
- fi; \\
- dashes=`echo "$$banner" | sed s/./=/g`; \\
- echo "$$dashes"; \\
- echo "$$banner"; \\
- echo "$$dashes"; \\
- test "$$failed" -eq 0
+ dashes=`echo "$$banner" | sed s/./=/g`; \\
+ echo "$$dashes"; \\
+ echo "$$banner"; \\
+ echo "$$dashes"; \\
+ test "$$failed" -eq 0; \\
+ fi
';
}
}