1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/pthread: migrate to testrunner script

This commit is contained in:
Alexandre Abadie 2017-10-29 11:06:26 +01:00
parent cc90f8a854
commit 7c446176a4
2 changed files with 28 additions and 0 deletions

View File

@ -8,3 +8,6 @@ USEMODULE += posix
USEMODULE += pthread
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

25
tests/pthread/tests/01-run.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import os
import sys
import math
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
import testrunner
FACTORIAL_PARAM = 6
def testfunc(child):
child.expect('main: parameter = {}'.format(FACTORIAL_PARAM))
child.expect('pthread: parameter = {}'.format(FACTORIAL_PARAM))
child.expect('pthread: factorial = {}'
.format(math.factorial(FACTORIAL_PARAM)))
child.expect('main: factorial = {}'
.format(math.factorial(FACTORIAL_PARAM)))
child.expect('SUCCESS')
if __name__ == "__main__":
sys.exit(testrunner.run(testfunc))