From 479064b7bf137492b9954ef139d3c7809b85b028 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 11:44:57 +0200 Subject: [PATCH 1/6] test/bitarithm_timings: added pexpect script --- tests/bitarithm_timings/Makefile | 3 +++ tests/bitarithm_timings/tests/01-run.py | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 tests/bitarithm_timings/tests/01-run.py 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)) From cbffe940b121a5fbeeede9c794e459e91a3dc163 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 11:49:55 +0200 Subject: [PATCH 2/6] tests/bloom_bytes: add pexpect script --- tests/bloom_bytes/Makefile | 3 +++ tests/bloom_bytes/tests/01-run.py | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 tests/bloom_bytes/tests/01-run.py 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)) From a88d1e93c5f752415e1825cb41201325b306f1e7 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 12:24:59 +0200 Subject: [PATCH 3/6] test/buttons: added pexpect script --- tests/buttons/Makefile | 3 +++ tests/buttons/tests/01-run.py | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 tests/buttons/tests/01-run.py 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)) From 8fb45cfc6bb07fcb3a52cac217abbe1b946eb9d4 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 13:24:58 +0200 Subject: [PATCH 4/6] tests/cpp11_confition_var: added pexpect script --- tests/cpp11_condition_variable/Makefile | 3 ++ .../cpp11_condition_variable/tests/01-run.py | 31 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 tests/cpp11_condition_variable/tests/01-run.py 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)) From b5030d5ab1e92e18f89b62cab7c8ae2c7b1c3c53 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 13:29:03 +0200 Subject: [PATCH 5/6] tests/cpp11_mutex: add pexpect script --- tests/cpp11_mutex/Makefile | 3 +++ tests/cpp11_mutex/tests/01-run.py | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 tests/cpp11_mutex/tests/01-run.py 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)) From d9512179bffd55458cb1374bedf4e5bdc2f821b6 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 18 Oct 2017 13:32:52 +0200 Subject: [PATCH 6/6] tests/cpp11_thread: added pexpect script --- tests/cpp11_thread/Makefile | 3 +++ tests/cpp11_thread/tests/01-run.py | 39 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 tests/cpp11_thread/tests/01-run.py 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))