From 993e0edf4e8078d10ddd5efa8156d62ce8f9d0c5 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Thu, 16 Mar 2017 09:14:59 +0100 Subject: make test: support out-of-tree tests env EXTERN_TESTS="/path/to/extra/tests" make test causes to run the default test set and tests collected from test_*.py files under subtree specified in EXTERN_TESTS. Change-Id: I58c5471dd6010730278a5b47d4318737d920bc28 Signed-off-by: Klement Sekera --- test/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test/Makefile') diff --git a/test/Makefile b/test/Makefile index 4338e09675e..c65eaae6bfe 100644 --- a/test/Makefile +++ b/test/Makefile @@ -23,10 +23,15 @@ verify-no-running-vpp: false; \ fi -UNITTEST_EXTRA_OPTS="" +UNITTEST_EXTRA_OPTS= +UNITTEST_FAILFAST_OPTS= ifeq ($(FAILFAST),1) -UNITTEST_EXTRA_OPTS="-f" +UNITTEST_EXTRA_OPTS=-f +endif + +ifneq ($(EXTERN_TESTS),) +UNITTEST_EXTRA_OPTS=$(UNITTEST_FAILFAST_OPTS) -d $(EXTERN_TESTS) endif PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv @@ -59,7 +64,7 @@ $(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE) @touch $@ define retest-func - @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover $(UNITTEST_EXTRA_OPTS) -p test_\"*.py\"" + @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS)" endef .PHONY: sanity -- cgit 1.2.3-korg