From 67187e240f315789de20ebbacdb44df133b5822d Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sun, 29 Oct 2017 11:50:25 +0100 Subject: [PATCH] tests/pthread_cooperation: migrate to testrunner script --- tests/pthread_cooperation/Makefile | 3 +++ tests/pthread_cooperation/tests/01-run.py | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 tests/pthread_cooperation/tests/01-run.py diff --git a/tests/pthread_cooperation/Makefile b/tests/pthread_cooperation/Makefile index 22b54c5611..cfb4ee6c8b 100644 --- a/tests/pthread_cooperation/Makefile +++ b/tests/pthread_cooperation/Makefile @@ -10,3 +10,6 @@ USEMODULE += posix USEMODULE += pthread include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/pthread_cooperation/tests/01-run.py b/tests/pthread_cooperation/tests/01-run.py new file mode 100755 index 0000000000..289259d3e1 --- /dev/null +++ b/tests/pthread_cooperation/tests/01-run.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + + +def testfunc(child): + child.expect('START') + + for i in range(12): + child.expect('Creating thread with arg {}'.format(i + 1)) + + for i in range(12): + child.expect('join thread {}'.format(i + 1)) + + child.expect('SUCCESS') + + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc))