From 2013af1b19965418c30a212f3abba5ee4a425337 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Wed, 21 Mar 2018 17:07:23 +0100 Subject: [PATCH] fix minor issues in test runner scripts on device (#4542) * tests/device/Makefile: use bourne shell compatible "." instead ot "source" (ubuntu's dash does not understand it) * tests/device: make BEGINTIMEOUT a new error return value instead of a test-process-breaking exception --- tests/device/libraries/BSTest/Makefile | 4 ++-- tests/device/libraries/BSTest/runner.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/device/libraries/BSTest/Makefile b/tests/device/libraries/BSTest/Makefile index b638bb4fe..c4216d9eb 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 diff --git a/tests/device/libraries/BSTest/runner.py b/tests/device/libraries/BSTest/runner.py index d4e534af0..e12b42711 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 @@ class BSTestRunner(object): 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+)',