diff --git a/tests/bitarithm_timings/Makefile b/tests/bitarithm_timings/Makefile index 4bbb98f201..3e5d341425 100644 --- a/tests/bitarithm_timings/Makefile +++ b/tests/bitarithm_timings/Makefile @@ -4,3 +4,6 @@ include ../Makefile.tests_common USEMODULE += xtimer include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/bitarithm_timings/tests/01-run.py b/tests/bitarithm_timings/tests/01-run.py new file mode 100755 index 0000000000..dfc6f446f9 --- /dev/null +++ b/tests/bitarithm_timings/tests/01-run.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2017 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + child.expect_exact("Start.") + child.expect('\+ bitarithm_msb: \d+ iterations per second') + child.expect('\+ bitarithm_lsb: \d+ iterations per second') + child.expect('\+ bitarithm_bits_set: \d+ iterations per second') + child.expect_exact("Done.") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc, timeout=30)) diff --git a/tests/bloom_bytes/Makefile b/tests/bloom_bytes/Makefile index 4800c93e1b..2d106f9b7c 100644 --- a/tests/bloom_bytes/Makefile +++ b/tests/bloom_bytes/Makefile @@ -12,3 +12,6 @@ USEMODULE += xtimer DISABLE_MODULE += auto_init include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/bloom_bytes/tests/01-run.py b/tests/bloom_bytes/tests/01-run.py new file mode 100755 index 0000000000..fc4a816117 --- /dev/null +++ b/tests/bloom_bytes/tests/01-run.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2017 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + child.expect_exact("Testing Bloom filter.") + child.expect_exact("m: 4096 k: 8") + child.expect("adding 512 elements took \d+ms") + child.expect("checking 10000 elements took \d+ms") + child.expect("\d+ elements probably in the filter.") + child.expect("\d+ elements not in the filter.") + child.expect(".+ false positive rate.") + child.expect_exact("All done!") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc)) diff --git a/tests/buttons/Makefile b/tests/buttons/Makefile index 9a5f773077..7816054a36 100644 --- a/tests/buttons/Makefile +++ b/tests/buttons/Makefile @@ -4,3 +4,6 @@ include ../Makefile.tests_common USEMODULE += xtimer include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/buttons/tests/01-run.py b/tests/buttons/tests/01-run.py new file mode 100755 index 0000000000..54647e5483 --- /dev/null +++ b/tests/buttons/tests/01-run.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2017 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + child.expect_exact("On-board button test") + index = child.expect([ + r"\[FAILED\] no buttons available!", + r" -- Available buttons: \d+" + ]) + + if index == 1: + child.expect_exact("[SUCCESS]") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc)) diff --git a/tests/cpp11_condition_variable/Makefile b/tests/cpp11_condition_variable/Makefile index d7ce2db609..7ce7abfaa9 100644 --- a/tests/cpp11_condition_variable/Makefile +++ b/tests/cpp11_condition_variable/Makefile @@ -24,3 +24,6 @@ USEMODULE += xtimer USEMODULE += timex include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/cpp11_condition_variable/tests/01-run.py b/tests/cpp11_condition_variable/tests/01-run.py new file mode 100755 index 0000000000..3ac6d799f1 --- /dev/null +++ b/tests/cpp11_condition_variable/tests/01-run.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser +# Copyright (C) 2016 Takuo Yonezawa +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + + child.expect_exact("************ C++ condition_variable test ***********") + child.expect_exact("Wait with predicate and notify one ...") + child.expect_exact("Done") + child.expect_exact("Wait and notify all ...") + child.expect_exact("Done") + child.expect_exact("Wait for ...") + child.expect_exact("Done") + child.expect_exact("Wait until ...") + child.expect_exact("Done") + child.expect_exact("Bye, bye.") + child.expect_exact("******************************************************") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc)) diff --git a/tests/cpp11_mutex/Makefile b/tests/cpp11_mutex/Makefile index a9e4cdaf49..29abb02fec 100644 --- a/tests/cpp11_mutex/Makefile +++ b/tests/cpp11_mutex/Makefile @@ -23,3 +23,6 @@ USEMODULE += cpp11-compat USEMODULE += xtimer include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/cpp11_mutex/tests/01-run.py b/tests/cpp11_mutex/tests/01-run.py new file mode 100755 index 0000000000..5be11d836a --- /dev/null +++ b/tests/cpp11_mutex/tests/01-run.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser +# Copyright (C) 2016 Takuo Yonezawa +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + + child.expect_exact("************ C++ mutex test ***********") + child.expect_exact("Lock and unlock ...") + child.expect_exact("Done") + child.expect_exact("Try_lock ...") + child.expect_exact("Done") + child.expect_exact("Bye, bye.") + child.expect_exact("*****************************************") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc)) diff --git a/tests/cpp11_thread/Makefile b/tests/cpp11_thread/Makefile index 012bcc7f2e..ee3e7f117e 100644 --- a/tests/cpp11_thread/Makefile +++ b/tests/cpp11_thread/Makefile @@ -24,3 +24,6 @@ USEMODULE += xtimer USEMODULE += timex include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/cpp11_thread/tests/01-run.py b/tests/cpp11_thread/tests/01-run.py new file mode 100755 index 0000000000..6636188ea9 --- /dev/null +++ b/tests/cpp11_thread/tests/01-run.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser +# Copyright (C) 2016 Takuo Yonezawa +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +import os +import sys + +sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) +import testrunner + +def testfunc(child): + + child.expect_exact("************ C++ thread test ***********") + child.expect_exact("Creating one thread and passing an argument ...") + child.expect_exact("Done") + child.expect_exact("Creating detached thread ...") + child.expect_exact("Done") + child.expect_exact("Join on 'finished' thread ...") + child.expect_exact("Done") + child.expect_exact("Join on 'running' thread ...") + child.expect_exact("Done") + child.expect_exact("Testing sleep_for ...") + child.expect_exact("Done") + child.expect_exact("Testing sleep_until ...") + child.expect_exact("Done") + child.expect_exact("Swapping two threads ...") + child.expect_exact("Done") + child.expect_exact("Move constructor ...") + child.expect_exact("Done") + child.expect_exact("Bye, bye.") + child.expect_exact("******************************************") + +if __name__ == "__main__": + sys.exit(testrunner.run(testfunc))