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:
parent
cc90f8a854
commit
7c446176a4
@ -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
25
tests/pthread/tests/01-run.py
Executable 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))
|
Loading…
Reference in New Issue
Block a user