tests: Add ability to automatically rerun failed tests.
[cascardo/ovs.git] / tests / automake.mk
index ef0a2f6..592f648 100644 (file)
@@ -115,7 +115,8 @@ DISTCLEANFILES += tests/atconfig tests/atlocal
 AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller
 
 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
-       $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
+       set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
+       "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 \f
 # Python Coverage support.
 # Requires coverage.py http://nedbatchelder.com/code/coverage/.