Skip to content

test suite: mbed assert detection #929

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
Feb 26, 2015
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
1 change: 1 addition & 0 deletions workspace_tools/host_tests/host_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def __init__(self):
self.RESULT_IOERR_COPY = "ioerr_copy"
self.RESULT_PASSIVE = "passive"
self.RESULT_NOT_DETECTED = "not_detected"
self.RESULT_MBED_ASSERT = "mbed_assert"


import workspace_tools.host_tests as host_tests
Expand Down
12 changes: 10 additions & 2 deletions workspace_tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class SingleTestRunner(object):
TEST_RESULT_IOERR_SERIAL = "IOERR_SERIAL"
TEST_RESULT_TIMEOUT = "TIMEOUT"
TEST_RESULT_NO_IMAGE = "NO_IMAGE"
TEST_RESULT_MBED_ASSERT = "MBED_ASSERT"

GLOBAL_LOOPS_COUNT = 1 # How many times each test should be repeated
TEST_LOOPS_LIST = [] # We redefine no.of loops per test_id
Expand All @@ -139,7 +140,8 @@ class SingleTestRunner(object):
"ioerr_serial" : TEST_RESULT_IOERR_SERIAL,
"timeout" : TEST_RESULT_TIMEOUT,
"no_image" : TEST_RESULT_NO_IMAGE,
"end" : TEST_RESULT_UNDEF
"end" : TEST_RESULT_UNDEF,
"mbed_assert" : TEST_RESULT_MBED_ASSERT
}

def __init__(self,
Expand Down Expand Up @@ -565,7 +567,8 @@ def generate_test_summary(self, test_summary, shuffle_seed=None):
self.TEST_RESULT_IOERR_DISK : 0,
self.TEST_RESULT_IOERR_SERIAL : 0,
self.TEST_RESULT_NO_IMAGE : 0,
self.TEST_RESULT_TIMEOUT : 0
self.TEST_RESULT_TIMEOUT : 0,
self.TEST_RESULT_MBED_ASSERT : 0
}

for test in test_summary:
Expand Down Expand Up @@ -878,6 +881,11 @@ def get_auto_property_value(property_name, line):
update_once_flag['timeout'] = True
duration = int(auto_timeout_val)

# Detect mbed assert:
if 'mbed assertation failed: ' in line:
output.append('{{mbed_assert}}')
break

# Check for test end
if '{end}' in line:
break
Expand Down