diff --git a/tests/bitarithm_timings/Makefile b/tests/bitarithm_timings/Makefile index 4bbb98f2017f931d93e92f263d3a6d84a8fd9068..3e5d3414258dca7e40217679128b0e47cd6fb702 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 0000000000000000000000000000000000000000..dfc6f446f9106e7c849d1a92d6dfeac085e673c3 --- /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 4800c93e1bbc8e4803668cd6c39a7c5f602a76b7..2d106f9b7c608edbc3344c272343f46013d7f1ac 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 0000000000000000000000000000000000000000..fc4a816117d16651f2134ae75071c509055c5c68 --- /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 9a5f773077042911a8f5931e5c0fdddc7d61b394..7816054a364859325ff7672f371e6b5638f8b75d 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 0000000000000000000000000000000000000000..54647e54834d832372c4c844c352cc4c6bfb92be --- /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 d7ce2db60977b534b8e21d52c324620ce599fbac..7ce7abfaa99b35ec17acca02115fecb85bfc5219 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 0000000000000000000000000000000000000000..3ac6d799f1c1b2fdf33310a9f883e9d8b7eeb49f --- /dev/null +++ b/tests/cpp11_condition_variable/tests/01-run.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> +# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp> +# +# 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 a9e4cdaf49fbec605256a191def6c01ef2f76ab8..29abb02fec777bb06900b3431a4ac6d16ebe0905 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 0000000000000000000000000000000000000000..5be11d836abaa3b5ca8509ddb97f164fa55c5923 --- /dev/null +++ b/tests/cpp11_mutex/tests/01-run.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> +# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp> +# +# 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 012bcc7f2e6f7ae3597eab7140aed586983e4012..ee3e7f117e589a26973f4e0eec9dcc675b498899 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 0000000000000000000000000000000000000000..6636188ea97823465535114a27fcc96508775996 --- /dev/null +++ b/tests/cpp11_thread/tests/01-run.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> +# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp> +# +# 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))