From d46357569df283dd49e5389c85b126c66d2399d1 Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Wed, 21 Mar 2018 14:11:41 +0100 Subject: [PATCH 1/2] tests/device/Makefile: use bourne shell compatible "." instead ot "source" (ubuntu's dash does not understand it) --- tests/device/libraries/BSTest/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/device/libraries/BSTest/Makefile b/tests/device/libraries/BSTest/Makefile index b638bb4fed..c4216d9eb9 100644 --- a/tests/device/libraries/BSTest/Makefile +++ b/tests/device/libraries/BSTest/Makefile @@ -11,10 +11,10 @@ clean: $(PYTHON_ENV_DIR): virtualenv --no-site-packages $(PYTHON_ENV_DIR) - source $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt + . $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR) - source $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE) + . $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE) $(TEST_EXECUTABLE): test/test.cpp g++ -std=c++11 -Isrc -o $@ test/test.cpp From ddc67b02e697c717856aea1cf93594f681085b6e Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Wed, 21 Mar 2018 14:12:53 +0100 Subject: [PATCH 2/2] tests/device: make BEGINTIMEOUT a new error return value instead of a test-process-breaking exception --- tests/device/libraries/BSTest/runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/device/libraries/BSTest/runner.py b/tests/device/libraries/BSTest/runner.py index d4e534af0a..e12b427118 100644 --- a/tests/device/libraries/BSTest/runner.py +++ b/tests/device/libraries/BSTest/runner.py @@ -32,6 +32,7 @@ class BSTestRunner(object): FAIL = 1 TIMEOUT = 2 CRASH = 3 + BEGINTIMEOUT = 4 def __init__(self, spawn_obj, name, mocks): self.sp = spawn_obj @@ -116,7 +117,7 @@ def run_test(self, index): time.sleep(0.1) timeout -= 0.1 if timeout <= 0: - raise 'test begin timeout' + return BSTestRunner.BEGINTIMEOUT while timeout > 0: res = self.sp.expect([r'>>>>>bs_test_check_failure line=(\d+)', r'>>>>>bs_test_end line=(\d+) result=(\d+) checks=(\d+) failed_checks=(\d+)',