diff --git a/tests/pthread/Makefile b/tests/pthread/Makefile index 2e2c8e2c1c84c2cf29abab63850c7b23ce57dd60..587c462f86c7d69e445c14779c0158a960c2611b 100644 --- a/tests/pthread/Makefile +++ b/tests/pthread/Makefile @@ -8,3 +8,6 @@ USEMODULE += posix USEMODULE += pthread include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/pthread/tests/01-run.py b/tests/pthread/tests/01-run.py new file mode 100755 index 0000000000000000000000000000000000000000..f2ae587229f9cadaf511dc49d94cdcb3be0872ad --- /dev/null +++ b/tests/pthread/tests/01-run.py @@ -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))