diff --git a/tests/bitarithm_timings/tests/01-run.py b/tests/bitarithm_timings/tests/01-run.py index bc8f4c236..3178e94cf 100755 --- a/tests/bitarithm_timings/tests/01-run.py +++ b/tests/bitarithm_timings/tests/01-run.py @@ -9,9 +9,6 @@ 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.") @@ -21,4 +18,6 @@ def testfunc(child): child.expect_exact("Done.") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=30)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=30)) diff --git a/tests/bloom_bytes/tests/01-run.py b/tests/bloom_bytes/tests/01-run.py index 6585ca348..de75b398f 100755 --- a/tests/bloom_bytes/tests/01-run.py +++ b/tests/bloom_bytes/tests/01-run.py @@ -9,9 +9,6 @@ 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.") @@ -24,4 +21,6 @@ def testfunc(child): child.expect_exact("All done!") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/buttons/tests/01-run.py b/tests/buttons/tests/01-run.py index 6037857e9..59437ecf3 100755 --- a/tests/buttons/tests/01-run.py +++ b/tests/buttons/tests/01-run.py @@ -9,9 +9,6 @@ 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") @@ -24,4 +21,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/cbor/tests/01-run.py b/tests/cbor/tests/01-run.py index c3ec006d3..68ec27dae 100755 --- a/tests/cbor/tests/01-run.py +++ b/tests/cbor/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - ACCEPTED_ERROR = 20 @@ -52,4 +49,6 @@ def testfunc(child): print("All tests successful") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, echo=False)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, echo=False)) diff --git a/tests/cpp11_condition_variable/tests/01-run.py b/tests/cpp11_condition_variable/tests/01-run.py index 5fde64fe2..c92f48c64 100755 --- a/tests/cpp11_condition_variable/tests/01-run.py +++ b/tests/cpp11_condition_variable/tests/01-run.py @@ -10,9 +10,6 @@ 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 ***********") @@ -28,4 +25,6 @@ def testfunc(child): child.expect_exact("******************************************************") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/cpp11_mutex/tests/01-run.py b/tests/cpp11_mutex/tests/01-run.py index 1646e6adf..76bf11d9d 100755 --- a/tests/cpp11_mutex/tests/01-run.py +++ b/tests/cpp11_mutex/tests/01-run.py @@ -10,9 +10,6 @@ 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 ***********") @@ -24,4 +21,6 @@ def testfunc(child): child.expect_exact("*****************************************") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/cpp11_thread/tests/01-run.py b/tests/cpp11_thread/tests/01-run.py index 0307f9238..98b91d1d4 100755 --- a/tests/cpp11_thread/tests/01-run.py +++ b/tests/cpp11_thread/tests/01-run.py @@ -10,9 +10,6 @@ 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 ***********") @@ -36,4 +33,6 @@ def testfunc(child): child.expect_exact("******************************************") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/driver_ds1307/tests/01-run.py b/tests/driver_ds1307/tests/01-run.py index 055199ef0..b9d290dc4 100755 --- a/tests/driver_ds1307/tests/01-run.py +++ b/tests/driver_ds1307/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect([r"OK \([0-9]+ tests\)", r"error: unable to initialize RTC \[I2C initialization error\]"]) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/driver_grove_ledbar/tests/01-run.py b/tests/driver_grove_ledbar/tests/01-run.py index 3d121d993..5b61fd1c9 100755 --- a/tests/driver_grove_ledbar/tests/01-run.py +++ b/tests/driver_grove_ledbar/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u"[SUCCESS]", timeout=60) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/driver_hd44780/tests/01-run.py b/tests/driver_hd44780/tests/01-run.py index c3b9f15a9..234d38d8b 100644 --- a/tests/driver_hd44780/tests/01-run.py +++ b/tests/driver_hd44780/tests/01-run.py @@ -10,13 +10,12 @@ 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_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/driver_my9221/tests/01-run.py b/tests/driver_my9221/tests/01-run.py index 7e48651f8..e5ee08c22 100755 --- a/tests/driver_my9221/tests/01-run.py +++ b/tests/driver_my9221/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("[SUCCESS]", timeout=60) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/events/tests/01-run.py b/tests/events/tests/01-run.py index 2b3bd8b37..fab469c90 100755 --- a/tests/events/tests/01-run.py +++ b/tests/events/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u"[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/evtimer_msg/tests/01-run.py b/tests/evtimer_msg/tests/01-run.py index e3b400e39..6f8c0eee4 100755 --- a/tests/evtimer_msg/tests/01-run.py +++ b/tests/evtimer_msg/tests/01-run.py @@ -10,9 +10,6 @@ from __future__ import print_function import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - ACCEPTED_ERROR = 20 @@ -32,4 +29,6 @@ def testfunc(child): print("All tests successful") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, echo=False)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, echo=False)) diff --git a/tests/evtimer_underflow/tests/01-run.py b/tests/evtimer_underflow/tests/01-run.py index 926f6cee5..60efd4d8d 100755 --- a/tests/evtimer_underflow/tests/01-run.py +++ b/tests/evtimer_underflow/tests/01-run.py @@ -10,9 +10,6 @@ from __future__ import print_function import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - how_many = 100 @@ -26,4 +23,6 @@ def testfunc(child): print("=> All tests successful") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, echo=False)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, echo=False)) diff --git a/tests/float/tests/01-run.py b/tests/float/tests/01-run.py index 38339e949..0bef7e65c 100755 --- a/tests/float/tests/01-run.py +++ b/tests/float/tests/01-run.py @@ -9,13 +9,12 @@ 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 floating point arithmetics...") child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/fmt_print/tests/01-run.py b/tests/fmt_print/tests/01-run.py index 7d6707a0f..913500e1c 100755 --- a/tests/fmt_print/tests/01-run.py +++ b/tests/fmt_print/tests/01-run.py @@ -3,13 +3,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('If you can read this:') child.expect_exact('Test successful.') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_ipv6_ext/tests/01-run.py b/tests/gnrc_ipv6_ext/tests/01-run.py index 1db44826b..3a56e803b 100755 --- a/tests/gnrc_ipv6_ext/tests/01-run.py +++ b/tests/gnrc_ipv6_ext/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): index = child.expect_exact([ @@ -41,4 +38,6 @@ def testfunc(child): child.expect_exact("pkt->users: 0") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_ipv6_nib/tests/01-run.py b/tests/gnrc_ipv6_nib/tests/01-run.py index d2ade821e..741c69575 100755 --- a/tests/gnrc_ipv6_nib/tests/01-run.py +++ b/tests/gnrc_ipv6_nib/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(r"OK \(\d+ tests\)") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=1)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py index d2ade821e..741c69575 100755 --- a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py +++ b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(r"OK \(\d+ tests\)") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=1)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_ndp/tests/01-run.py b/tests/gnrc_ndp/tests/01-run.py index 1f1039f78..dcc3c5d7f 100755 --- a/tests/gnrc_ndp/tests/01-run.py +++ b/tests/gnrc_ndp/tests/01-run.py @@ -10,13 +10,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): # 1st 6LoWPAN fragment child.expect(r"OK \(\d+ tests\)") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_netif/tests/01-run.py b/tests/gnrc_netif/tests/01-run.py index 255f8a5b4..7901d4b7c 100755 --- a/tests/gnrc_netif/tests/01-run.py +++ b/tests/gnrc_netif/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): # embUnit tests @@ -140,4 +137,6 @@ def testfunc(child): child.expect("~~ PKT - 2 snips, total size: 61 byte") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=1, traceback=True)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=1, traceback=True)) diff --git a/tests/gnrc_sixlowpan/tests/01-run.py b/tests/gnrc_sixlowpan/tests/01-run.py index a7d1842ce..5138e3440 100755 --- a/tests/gnrc_sixlowpan/tests/01-run.py +++ b/tests/gnrc_sixlowpan/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): # 1st 6LoWPAN fragment @@ -78,4 +75,6 @@ def testfunc(child): child.expect_exact("destination address: fd01::1") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_sock_ip/tests/01-run.py b/tests/gnrc_sock_ip/tests/01-run.py index 0f5eea832..dfe4e3077 100755 --- a/tests/gnrc_sock_ip/tests/01-run.py +++ b/tests/gnrc_sock_ip/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()") @@ -51,4 +48,6 @@ def testfunc(child): child.expect_exact(u"ALL TESTS SUCCESSFUL") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/gnrc_sock_udp/tests/01-run.py b/tests/gnrc_sock_udp/tests/01-run.py index f553d17c1..a91d62103 100755 --- a/tests/gnrc_sock_udp/tests/01-run.py +++ b/tests/gnrc_sock_udp/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u"Calling test_sock_udp_create__EADDRINUSE()") @@ -55,4 +52,6 @@ def testfunc(child): child.expect_exact(u"ALL TESTS SUCCESSFUL") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/irq/tests/01-run.py b/tests/irq/tests/01-run.py index 54be44a74..f5394a40b 100755 --- a/tests/irq/tests/01-run.py +++ b/tests/irq/tests/01-run.py @@ -3,13 +3,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') child.expect('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/libfixmath/tests/01-run.py b/tests/libfixmath/tests/01-run.py index 92e5f4544..71916e93e 100755 --- a/tests/libfixmath/tests/01-run.py +++ b/tests/libfixmath/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def expect_unary(child): for _ in range(20): @@ -41,4 +38,6 @@ def testfunc(child): child.expect_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/libfixmath_unittests/tests/01-run.py b/tests/libfixmath_unittests/tests/01-run.py index 0a1cecc7d..737987663 100755 --- a/tests/libfixmath_unittests/tests/01-run.py +++ b/tests/libfixmath_unittests/tests/01-run.py @@ -9,12 +9,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/lwip_sock_ip/tests/01-run.py b/tests/lwip_sock_ip/tests/01-run.py index 96f73bdd8..36cd5a0a8 100755 --- a/tests/lwip_sock_ip/tests/01-run.py +++ b/tests/lwip_sock_ip/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def _ipv6_tests(code): return code & (1 << 6) @@ -99,4 +96,6 @@ def testfunc(child): child.expect_exact(u"ALL TESTS SUCCESSFUL") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/lwip_sock_tcp/tests/01-run.py b/tests/lwip_sock_tcp/tests/01-run.py index 176c99852..5ceb51e3e 100755 --- a/tests/lwip_sock_tcp/tests/01-run.py +++ b/tests/lwip_sock_tcp/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def _reuse_tests(code): return code & 1 @@ -93,4 +90,6 @@ def testfunc(child): child.expect_exact(u"ALL TESTS SUCCESSFUL") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=60)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=60)) diff --git a/tests/lwip_sock_udp/tests/01-run.py b/tests/lwip_sock_udp/tests/01-run.py index ba0887ad2..7cbc8007b 100755 --- a/tests/lwip_sock_udp/tests/01-run.py +++ b/tests/lwip_sock_udp/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def _reuse_tests(code): return code & 1 @@ -111,4 +108,6 @@ def testfunc(child): child.expect_exact(u"ALL TESTS SUCCESSFUL") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/msg_avail/tests/01-run.py b/tests/msg_avail/tests/01-run.py index 2b3bd8b37..fab469c90 100755 --- a/tests/msg_avail/tests/01-run.py +++ b/tests/msg_avail/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u"[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/msg_send_receive/tests/01-run.py b/tests/msg_send_receive/tests/01-run.py index 9ff95cf95..26a28d1a2 100755 --- a/tests/msg_send_receive/tests/01-run.py +++ b/tests/msg_send_receive/tests/01-run.py @@ -9,12 +9,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(u"Test successful.") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/msg_try_receive/tests/01-run.py b/tests/msg_try_receive/tests/01-run.py index 75c63e565..d69458c3f 100755 --- a/tests/msg_try_receive/tests/01-run.py +++ b/tests/msg_try_receive/tests/01-run.py @@ -3,13 +3,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('main starting') child.expect('msg available: 1 \(should be 1\!\)') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/mutex_order/tests/01-run.py b/tests/mutex_order/tests/01-run.py index 85e800f94..4dbeb3295 100755 --- a/tests/mutex_order/tests/01-run.py +++ b/tests/mutex_order/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - thread_prio = { 3: 6, 4: 4, @@ -33,4 +30,6 @@ def testfunc(child): last = int(child.match.group(1)) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/mutex_unlock_and_sleep/tests/01-run.py b/tests/mutex_unlock_and_sleep/tests/01-run.py index eb74e3799..632c66ab1 100755 --- a/tests/mutex_unlock_and_sleep/tests/01-run.py +++ b/tests/mutex_unlock_and_sleep/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): for i in range(20): child.expect(r"\[ALIVE\] alternated \d+k times.") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/netdev_test/tests/01-run.py b/tests/netdev_test/tests/01-run.py index 757c1bd24..615046f43 100755 --- a/tests/netdev_test/tests/01-run.py +++ b/tests/netdev_test/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('Executing test_get_addr()') @@ -25,4 +22,6 @@ def testfunc(child): child.expect_exact('ALL TESTS SUCCESSFUL') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/nhdp/tests/01-run.py b/tests/nhdp/tests/01-run.py index ffbbecfe9..ee451a7d3 100755 --- a/tests/nhdp/tests/01-run.py +++ b/tests/nhdp/tests/01-run.py @@ -9,12 +9,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('SUCCESS: NHDP compiled!') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/od/tests/01-run.py b/tests/od/tests/01-run.py index cb4e8f7f6..d99d4300a 100755 --- a/tests/od/tests/01-run.py +++ b/tests/od/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)") @@ -42,4 +39,6 @@ def testfunc(child): print("All tests successful") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=1, echo=False)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=1, echo=False)) diff --git a/tests/od/tests/02-run.py b/tests/od/tests/02-run.py index 5d6c14abe..3e99f59b9 100755 --- a/tests/od/tests/02-run.py +++ b/tests/od/tests/02-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)") @@ -42,4 +39,6 @@ def testfunc(child): print("All tests successful") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=1, echo=False)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=1, echo=False)) diff --git a/tests/periph_timer/tests/01-run.py b/tests/periph_timer/tests/01-run.py index eca2be635..5e6a8f7cd 100755 --- a/tests/periph_timer/tests/01-run.py +++ b/tests/periph_timer/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('Available timers: (\d+)') @@ -24,4 +21,6 @@ def testfunc(child): child.expect('TEST SUCCEEDED') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pipe/tests/01-run.py b/tests/pipe/tests/01-run.py index 1130f89c6..8965b5a72 100755 --- a/tests/pipe/tests/01-run.py +++ b/tests/pipe/tests/01-run.py @@ -3,9 +3,6 @@ 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.') @@ -32,4 +29,6 @@ def testfunc(child): child.expect_exact('End done.') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pkg_jsmn/tests/01-run.py b/tests/pkg_jsmn/tests/01-run.py index c3f8a0f0b..c5e46800e 100755 --- a/tests/pkg_jsmn/tests/01-run.py +++ b/tests/pkg_jsmn/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('- User: johndoe') @@ -18,4 +15,6 @@ def testfunc(child): child.expect_exact(' * video') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pkg_libcoap/tests/01-run.py b/tests/pkg_libcoap/tests/01-run.py index 361082aff..dd4a7748f 100755 --- a/tests/pkg_libcoap/tests/01-run.py +++ b/tests/pkg_libcoap/tests/01-run.py @@ -3,12 +3,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('SUCCESS: Libcoap compiled!') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py b/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py index 87ee4f1cf..4118445bc 100755 --- a/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py +++ b/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('micro-ecc compiled!') @@ -15,4 +12,6 @@ def testfunc(child): child.expect_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=60)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=60)) diff --git a/tests/pkg_micro-ecc/tests/01-run.py b/tests/pkg_micro-ecc/tests/01-run.py index c03e53b7b..513681ac1 100755 --- a/tests/pkg_micro-ecc/tests/01-run.py +++ b/tests/pkg_micro-ecc/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('micro-ecc compiled!') @@ -15,4 +12,6 @@ def testfunc(child): child.expect_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=60)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=60)) diff --git a/tests/pkg_minmea/tests/01-run.py b/tests/pkg_minmea/tests/01-run.py index e6aba51b0..dc6d8b547 100755 --- a/tests/pkg_minmea/tests/01-run.py +++ b/tests/pkg_minmea/tests/01-run.py @@ -3,13 +3,12 @@ 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_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pkg_tiny-asn1/tests/01-run.py b/tests/pkg_tiny-asn1/tests/01-run.py index 0c25de935..674ed5a8e 100755 --- a/tests/pkg_tiny-asn1/tests/01-run.py +++ b/tests/pkg_tiny-asn1/tests/01-run.py @@ -10,12 +10,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('Decoding finished succesfully') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pkg_umorse/tests/01-run.py b/tests/pkg_umorse/tests/01-run.py index 19c6dd918..b3fe164f1 100755 --- a/tests/pkg_umorse/tests/01-run.py +++ b/tests/pkg_umorse/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(u".... . ._.. ._.. ___ / ._. .. ___ _ ___ ...", timeout=30) @@ -23,4 +20,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]", timeout=120) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/posix_semaphore/tests/01-run.py b/tests/posix_semaphore/tests/01-run.py index 6e827717b..cb5bf3a01 100755 --- a/tests/posix_semaphore/tests/01-run.py +++ b/tests/posix_semaphore/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def test1(term): term.expect_exact("######################### TEST1:") @@ -100,4 +97,6 @@ def testfunc(child): child.expect("######################### DONE") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/posix_time/tests/01-run.py b/tests/posix_time/tests/01-run.py index 036cf5026..324ea3393 100755 --- a/tests/posix_time/tests/01-run.py +++ b/tests/posix_time/tests/01-run.py @@ -12,9 +12,6 @@ import os import sys import time -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - US_PER_SEC = 1000000 EXTERNAL_JITTER = 0.15 @@ -48,4 +45,6 @@ def testfunc(child): sys.exit(1) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, echo=True)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/ps_schedstatistics/tests/01-run.py b/tests/ps_schedstatistics/tests/01-run.py index 3138b3dd0..5d76f3d60 100755 --- a/tests/ps_schedstatistics/tests/01-run.py +++ b/tests/ps_schedstatistics/tests/01-run.py @@ -9,10 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - - PS_EXPECTED = ( ('\tpid | name | state Q | pri | stack ( used) | ' 'base addr | current | runtime | switches'), @@ -63,4 +59,6 @@ def testfunc(child): _check_ps(child) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread/tests/01-run.py b/tests/pthread/tests/01-run.py index f2ae58722..7a28b9d68 100755 --- a/tests/pthread/tests/01-run.py +++ b/tests/pthread/tests/01-run.py @@ -4,10 +4,6 @@ import os import sys import math -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - - FACTORIAL_PARAM = 6 @@ -22,4 +18,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread_barrier/tests/01-run.py b/tests/pthread_barrier/tests/01-run.py index 9dcab9af7..197085bea 100755 --- a/tests/pthread_barrier/tests/01-run.py +++ b/tests/pthread_barrier/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') @@ -19,4 +16,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread_cleanup/tests/01-run.py b/tests/pthread_cleanup/tests/01-run.py index 91d45f5f4..5bf3a9e64 100755 --- a/tests/pthread_cleanup/tests/01-run.py +++ b/tests/pthread_cleanup/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') @@ -23,4 +20,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread_condition_variable/tests/01-run.py b/tests/pthread_condition_variable/tests/01-run.py index a88053e6f..af8c00704 100755 --- a/tests/pthread_condition_variable/tests/01-run.py +++ b/tests/pthread_condition_variable/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') @@ -16,4 +13,6 @@ def testfunc(child): if __name__ == "__main__": # This test can take some time to complete when testing on hardware (e.g # on samr21-xpro) and the default timeout (10s) is not enough. - sys.exit(testrunner.run(testfunc, timeout=60)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=60)) diff --git a/tests/pthread_cooperation/tests/01-run.py b/tests/pthread_cooperation/tests/01-run.py index 289259d3e..a88a5975c 100755 --- a/tests/pthread_cooperation/tests/01-run.py +++ b/tests/pthread_cooperation/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') @@ -20,4 +17,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread_rwlock/tests/01-run.py b/tests/pthread_rwlock/tests/01-run.py index 260c44926..3dad83916 100755 --- a/tests/pthread_rwlock/tests/01-run.py +++ b/tests/pthread_rwlock/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('START') @@ -19,4 +16,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/pthread_tls/tests/01-run.py b/tests/pthread_tls/tests/01-run.py index 12435e7b9..004395d4e 100755 --- a/tests/pthread_tls/tests/01-run.py +++ b/tests/pthread_tls/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def _check_test_output(child): child.expect('show tls values:') @@ -38,4 +35,6 @@ def testfunc(child): child.expect('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/rmutex/tests/01-run.py b/tests/rmutex/tests/01-run.py index f9a86d1c6..a68a109ce 100755 --- a/tests/rmutex/tests/01-run.py +++ b/tests/rmutex/tests/01-run.py @@ -11,9 +11,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - thread_prio = { 3: 6, 4: 4, @@ -47,4 +44,6 @@ def testfunc(child): (T, thread_prio[T], depth)) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/sched_testing/tests/01-run.py b/tests/sched_testing/tests/01-run.py index 5adc76036..c383d7901 100755 --- a/tests/sched_testing/tests/01-run.py +++ b/tests/sched_testing/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('The output should be: yield 1, snd_thread running, ' @@ -18,4 +15,6 @@ def testfunc(child): child.expect_exact('done') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/shell/tests/01-run.py b/tests/shell/tests/01-run.py index b255b8aa4..c2e309f65 100755 --- a/tests/shell/tests/01-run.py +++ b/tests/shell/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - EXPECTED_HELP = ( 'Command Description', '---------------------------------------', @@ -58,4 +55,6 @@ def testfunc(child): check_cmd(child, cmd, expected) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/sizeof_tcb/tests/01-run.py b/tests/sizeof_tcb/tests/01-run.py index 5d568051f..831ee218a 100755 --- a/tests/sizeof_tcb/tests/01-run.py +++ b/tests/sizeof_tcb/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('\tmember, sizeof, offsetof') @@ -28,4 +25,6 @@ def testfunc(child): child.expect_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/ssp/tests/01-run.py b/tests/ssp/tests/01-run.py index 6de5ad714..8b5334ff8 100755 --- a/tests/ssp/tests/01-run.py +++ b/tests/ssp/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('calling stack corruption function') child.expect('.*stack smashing detected.*') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/struct_tm_utility/tests/01-run.py b/tests/struct_tm_utility/tests/01-run.py index 078d4db9c..91fa7fa48 100755 --- a/tests/struct_tm_utility/tests/01-run.py +++ b/tests/struct_tm_utility/tests/01-run.py @@ -11,9 +11,6 @@ import sys import calendar import datetime -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def _check_help(child): child.sendline('help') @@ -116,4 +113,6 @@ def testfunc(child): _check_day(child) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_basic/tests/01-run.py b/tests/thread_basic/tests/01-run.py index 5a7f5034b..74e3fcd77 100755 --- a/tests/thread_basic/tests/01-run.py +++ b/tests/thread_basic/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('first thread\r\n') child.expect('second thread\r\n') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_cooperation/tests/01-run.py b/tests/thread_cooperation/tests/01-run.py index 9b6ecbfbd..84bcbbb0d 100755 --- a/tests/thread_cooperation/tests/01-run.py +++ b/tests/thread_cooperation/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(r"MAIN: reply from T-\d+") @@ -20,4 +17,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_exit/tests/01-run.py b/tests/thread_exit/tests/01-run.py index c3e6ce101..dfc2c1136 100755 --- a/tests/thread_exit/tests/01-run.py +++ b/tests/thread_exit/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect("main: starting") @@ -19,4 +16,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_flags/tests/01-run.py b/tests/thread_flags/tests/01-run.py index 7258ef424..8b0b8f560 100755 --- a/tests/thread_flags/tests/01-run.py +++ b/tests/thread_flags/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect("START") @@ -31,4 +28,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_flags_xtimer/tests/01-run.py b/tests/thread_flags_xtimer/tests/01-run.py index 9f2a5e8e0..5f2c50d36 100755 --- a/tests/thread_flags_xtimer/tests/01-run.py +++ b/tests/thread_flags_xtimer/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect("START") @@ -15,4 +12,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_flood/tests/01-run.py b/tests/thread_flood/tests/01-run.py index 4cc744e01..7e7cb5586 100755 --- a/tests/thread_flood/tests/01-run.py +++ b/tests/thread_flood/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact(u'[START] Spawning threads') @@ -13,4 +10,6 @@ def testfunc(child): child.expect(r'\[SUCCESS\] created \d+') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_msg/tests/01-run.py b/tests/thread_msg/tests/01-run.py index f09411b81..57d9f326e 100755 --- a/tests/thread_msg/tests/01-run.py +++ b/tests/thread_msg/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact('THREADS CREATED') @@ -16,4 +13,6 @@ def testfunc(child): child.expect_exact('SUCCESS') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_msg_block_w_queue/tests/01-run.py b/tests/thread_msg_block_w_queue/tests/01-run.py index 0a9a8ee4b..3ab9705cb 100755 --- a/tests/thread_msg_block_w_queue/tests/01-run.py +++ b/tests/thread_msg_block_w_queue/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('sender_thread start\r\n') child.expect('main thread alive\r\n') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_msg_block_wo_queue/tests/01-run.py b/tests/thread_msg_block_wo_queue/tests/01-run.py index 0a9a8ee4b..3ab9705cb 100755 --- a/tests/thread_msg_block_wo_queue/tests/01-run.py +++ b/tests/thread_msg_block_wo_queue/tests/01-run.py @@ -9,13 +9,12 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect('sender_thread start\r\n') child.expect('main thread alive\r\n') if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/thread_msg_seq/tests/01-run.py b/tests/thread_msg_seq/tests/01-run.py index b1e52cfd9..7f099853d 100755 --- a/tests/thread_msg_seq/tests/01-run.py +++ b/tests/thread_msg_seq/tests/01-run.py @@ -3,9 +3,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect("START") @@ -23,4 +20,6 @@ def testfunc(child): if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/trickle/tests/01-run.py b/tests/trickle/tests/01-run.py index 33ad94d77..47afeebe7 100755 --- a/tests/trickle/tests/01-run.py +++ b/tests/trickle/tests/01-run.py @@ -9,9 +9,6 @@ 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]") @@ -27,4 +24,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/unittests/tests/01-run.py b/tests/unittests/tests/01-run.py index c8183c2a4..48b7ac912 100755 --- a/tests/unittests/tests/01-run.py +++ b/tests/unittests/tests/01-run.py @@ -9,12 +9,11 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(u"OK \\([0-9]+ tests\\)") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, timeout=60)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc, timeout=60)) diff --git a/tests/xtimer_hang/tests/01-run.py b/tests/xtimer_hang/tests/01-run.py index cc44b205a..68676388e 100755 --- a/tests/xtimer_hang/tests/01-run.py +++ b/tests/xtimer_hang/tests/01-run.py @@ -9,9 +9,6 @@ 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]") @@ -24,4 +21,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_msg_receive_timeout/tests/01-run.py b/tests/xtimer_msg_receive_timeout/tests/01-run.py index 5cfc83c7a..2de740b50 100755 --- a/tests/xtimer_msg_receive_timeout/tests/01-run.py +++ b/tests/xtimer_msg_receive_timeout/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect("[START]") @@ -21,4 +18,6 @@ def testfunc(child): child.expect("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_now64_continuity/tests/01-run.py b/tests/xtimer_now64_continuity/tests/01-run.py index 828efb660..471c537da 100755 --- a/tests/xtimer_now64_continuity/tests/01-run.py +++ b/tests/xtimer_now64_continuity/tests/01-run.py @@ -9,9 +9,6 @@ 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]") @@ -19,4 +16,6 @@ def testfunc(child): child.expect_exact("[SUCCESS]") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_periodic_wakeup/tests/01-run.py b/tests/xtimer_periodic_wakeup/tests/01-run.py index 433ce1624..6012617a7 100755 --- a/tests/xtimer_periodic_wakeup/tests/01-run.py +++ b/tests/xtimer_periodic_wakeup/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("xtimer_periodic_wakeup test application.") @@ -25,4 +22,6 @@ def testfunc(child): child.expect_exact("Test complete.") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_remove/tests/01-run.py b/tests/xtimer_remove/tests/01-run.py index 8b7c52706..56dfa19f2 100755 --- a/tests/xtimer_remove/tests/01-run.py +++ b/tests/xtimer_remove/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("xtimer_remove test application.") @@ -27,4 +24,6 @@ def testfunc(child): child.expect_exact("test successful.") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_reset/tests/01-run.py b/tests/xtimer_reset/tests/01-run.py index 87f31a0b8..11af52756 100755 --- a/tests/xtimer_reset/tests/01-run.py +++ b/tests/xtimer_reset/tests/01-run.py @@ -9,9 +9,6 @@ import os import sys -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect_exact("This test tests re-setting of an already active timer.") @@ -23,4 +20,6 @@ def testfunc(child): child.expect_exact("Test completed!") if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_usleep/tests/01-run.py b/tests/xtimer_usleep/tests/01-run.py index 3e41763a1..01c5fc6c3 100755 --- a/tests/xtimer_usleep/tests/01-run.py +++ b/tests/xtimer_usleep/tests/01-run.py @@ -13,9 +13,6 @@ import os import sys import time -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - US_PER_SEC = 1000000 INTERNAL_JITTER = 0.05 EXTERNAL_JITTER = 0.15 @@ -55,4 +52,6 @@ def testfunc(child): sys.exit(1) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc, echo=True)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc)) diff --git a/tests/xtimer_usleep_short/tests/01-run.py b/tests/xtimer_usleep_short/tests/01-run.py index 5fc2385ef..fb43acd74 100755 --- a/tests/xtimer_usleep_short/tests/01-run.py +++ b/tests/xtimer_usleep_short/tests/01-run.py @@ -10,9 +10,6 @@ import os import sys import pexpect -sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) -import testrunner - def testfunc(child): child.expect(u"This test will call xtimer_usleep for values from \\d+ down to \\d+\r\n") @@ -31,4 +28,6 @@ def testfunc(child): child.expect(u"[SUCCESS]", timeout=3) if __name__ == "__main__": - sys.exit(testrunner.run(testfunc)) + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc))