diff --git a/tests/pipe/Makefile b/tests/pipe/Makefile index 1eb1913b4c..eac90671fa 100644 --- a/tests/pipe/Makefile +++ b/tests/pipe/Makefile @@ -6,3 +6,6 @@ BOARD_INSUFFICIENT_MEMORY := nucleo32-f031 USEMODULE += pipe include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/pipe/tests/01-run.py b/tests/pipe/tests/01-run.py new file mode 100755 index 0000000000..64086c37e2 --- /dev/null +++ b/tests/pipe/tests/01-run.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +import os +import sys +import math + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + + +def testfunc(child): + child.expect_exact('Start.') + child.expect_exact('Middle read: [0:4]') + child.expect_exact('Middle read: [4:6]') + child.expect_exact('End read: [0:3]') + child.expect_exact('End read: [3:6]') + child.expect_exact('Middle read: [6:10]') + child.expect_exact('Middle read: [10:12]') + child.expect_exact('End read: [6:9]') + child.expect_exact('End read: [9:12]') + child.expect_exact('Middle read: [12:16]') + child.expect_exact('Middle read: [16:18]') + child.expect_exact('End read: [12:15]') + child.expect_exact('End read: [15:18]') + child.expect_exact('Middle read: [18:22]') + child.expect_exact('Middle read: [22:24]') + child.expect_exact('Main done.') + child.expect_exact('End read: [18:21]') + child.expect_exact('End read: [21:24]') + child.expect_exact('Middle read: [24:26]') + child.expect_exact('Middle done.') + child.expect_exact('End read: [24:26]') + child.expect_exact('End done.') + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc))