1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #7756 from haukepetersen/opt_test_addtesttarget

tests: added some more pexpect scripts
This commit is contained in:
Martine Lenders 2017-10-19 15:50:27 +02:00 committed by GitHub
commit 8b00538854
12 changed files with 190 additions and 0 deletions

View File

@ -4,3 +4,6 @@ include ../Makefile.tests_common
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -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))

View File

@ -12,3 +12,6 @@ USEMODULE += xtimer
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -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))

View File

@ -4,3 +4,6 @@ include ../Makefile.tests_common
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

26
tests/buttons/tests/01-run.py Executable file
View File

@ -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))

View File

@ -24,3 +24,6 @@ USEMODULE += xtimer
USEMODULE += timex
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -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))

View File

@ -23,3 +23,6 @@ USEMODULE += cpp11-compat
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -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))

View File

@ -24,3 +24,6 @@ USEMODULE += xtimer
USEMODULE += timex
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -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))