tests/bench_runtime_coreapis: improve pexpect autotest

This commit is contained in:
Alexandre Abadie 2018-12-11 14:55:50 +01:00
parent 4e7bfb65df
commit f90c69cf6e

View File

@ -12,10 +12,21 @@ from testrunner import run
# The default timeout is not enough for this test on some of the slower boards
TIMEOUT = 30
BENCHMARK_REGEXP = r"\s+{func}:\s+\d+us\s+---\s+\d*\.*\d+us per call\s+---\s+\d+ calls per sec"
def testfunc(child):
child.expect_exact('[SUCCESS]', timeout=TIMEOUT)
child.expect_exact('Runtime of Selected Core API functions')
child.expect(BENCHMARK_REGEXP.format(func="nop loop"))
child.expect(BENCHMARK_REGEXP.format(func=r"mutex_init\(\)"))
child.expect(BENCHMARK_REGEXP.format(func="mutex lock/unlock"), timeout=TIMEOUT)
child.expect(BENCHMARK_REGEXP.format(func=r"thread_flags_set\(\)"))
child.expect(BENCHMARK_REGEXP.format(func="thread flags set/wait any"), timeout=TIMEOUT)
child.expect(BENCHMARK_REGEXP.format(func="thread flags set/wait all"), timeout=TIMEOUT)
child.expect(BENCHMARK_REGEXP.format(func="thread flags set/wait one"), timeout=TIMEOUT)
child.expect(BENCHMARK_REGEXP.format(func=r"msg_try_receive\(\)"))
child.expect(BENCHMARK_REGEXP.format(func=r"msg_avail\(\)"))
child.expect_exact('[SUCCESS]')
if __name__ == "__main__":