diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 95a91d58c9e..c06095d66ff 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -91,17 +91,17 @@ RUN_MOCHITEST_ROBOTIUM = \ --robocop=$(DEPTH)/build/mobile/robocop/robocop.ini $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) ifndef NO_FAIL_ON_TEST_ERRORS -define CHECK_TEST_ERROR +define check_test_error_internal @errors=`grep "TEST-UNEXPECTED-" $@.log` ;\ if test "$$errors" ; then \ echo "$@ failed:"; \ echo "$$errors"; \ - echo "To rerun your failures please run 'make mochitest-plain-rerun-failures'"; \ + $(if $(1),echo $(1)) \ exit 1; \ - else \ - echo "$@ passed"; \ fi endef +CHECK_TEST_ERROR = $(call check_test_error_internal) +CHECK_TEST_ERROR_RERUN = $(call check_test_error_internal,"To rerun your failures please run 'make $@-rerun-failures'") endif mochitest-remote: DM_TRANS?=adb @@ -127,11 +127,11 @@ mochitest-robotium: mochitest-plain: $(RUN_MOCHITEST) - $(CHECK_TEST_ERROR) + $(CHECK_TEST_ERROR_RERUN) mochitest-plain-rerun-failures: $(RERUN_MOCHITEST) - $(CHECK_TEST_ERROR) + $(CHECK_TEST_ERROR_RERUN) # Allow mochitest-1 ... mochitest-5 for developer ease mochitest-1 mochitest-2 mochitest-3 mochitest-4 mochitest-5: mochitest-%: