Makefile: fail REGRESS=1 when earlier step fails

When running tests with REGRESS=1, the Makefile would not exit with
failure if an earlier step failed some tests.  Replacing ; with && in
the test rule fixed this behaviour to exit with failure exitcode on the
first regression failure.
This commit is contained in:
Dov Murik 2016-03-30 10:14:48 -04:00
parent a04bfb67bc
commit d5221bcf04

View file

@ -320,12 +320,13 @@ $(foreach i,$(DO_IMPLS),$(foreach s,$(STEPS),$(i)^$(s))): $$(call $$(word 1,$$(s
$(ALL_TESTS): $$(call $$(word 2,$$(subst ^, ,$$(@)))_STEP_TO_PROG,$$(word 3,$$(subst ^, ,$$(@)))) $(ALL_TESTS): $$(call $$(word 2,$$(subst ^, ,$$(@)))_STEP_TO_PROG,$$(word 3,$$(subst ^, ,$$(@))))
@$(foreach impl,$(word 2,$(subst ^, ,$(@))),\ @$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
$(foreach step,$(word 3,$(subst ^, ,$(@))),\ $(foreach step,$(word 3,$(subst ^, ,$(@))),\
cd $(if $(filter mal,$(impl)),$(MAL_IMPL),$(impl)); \ cd $(if $(filter mal,$(impl)),$(MAL_IMPL),$(impl)) && \
$(foreach test,$(call STEP_TEST_FILES,$(impl),$(step)),\ $(foreach test,$(call STEP_TEST_FILES,$(impl),$(step)),\
echo '----------------------------------------------'; \ echo '----------------------------------------------' && \
echo 'Testing $@, step file: $+, test file: $(test)'; \ echo 'Testing $@, step file: $+, test file: $(test)' && \
echo 'Running: $(call get_run_prefix,$(impl))../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+))'; \ echo 'Running: $(call get_run_prefix,$(impl))../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+))' && \
$(call get_run_prefix,$(impl))../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+));))) $(call get_run_prefix,$(impl))../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+)) &&) \
true))
# Allow test, tests, test^STEP, test^IMPL, and test^IMPL^STEP # Allow test, tests, test^STEP, test^IMPL, and test^IMPL^STEP
test: $(ALL_TESTS) test: $(ALL_TESTS)