Skip to content

fix minor issues in test runner scripts on device #4542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/device/libraries/BSTest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/device/libraries/BSTest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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+)',
Expand Down