diff --git a/tests/bitarithm_timings/tests/01-run.py b/tests/bitarithm_timings/tests/01-run.py index 3178e94cfc..07b53e69b2 100755 --- a/tests/bitarithm_timings/tests/01-run.py +++ b/tests/bitarithm_timings/tests/01-run.py @@ -17,6 +17,7 @@ def testfunc(child): child.expect('\+ bitarithm_bits_set: \d+ iterations per second') child.expect_exact("Done.") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/bloom_bytes/tests/01-run.py b/tests/bloom_bytes/tests/01-run.py index de75b398f4..c6ee02d48d 100755 --- a/tests/bloom_bytes/tests/01-run.py +++ b/tests/bloom_bytes/tests/01-run.py @@ -20,6 +20,7 @@ def testfunc(child): child.expect(".+ false positive rate.") child.expect_exact("All done!") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/buttons/tests/01-run.py b/tests/buttons/tests/01-run.py index 59437ecf37..9dc3845b01 100755 --- a/tests/buttons/tests/01-run.py +++ b/tests/buttons/tests/01-run.py @@ -20,6 +20,7 @@ def testfunc(child): if index == 1: child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/cbor/tests/01-run.py b/tests/cbor/tests/01-run.py index 68ec27daef..bb351a5334 100755 --- a/tests/cbor/tests/01-run.py +++ b/tests/cbor/tests/01-run.py @@ -48,6 +48,7 @@ def testfunc(child): print("All tests successful") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/cpp11_condition_variable/tests/01-run.py b/tests/cpp11_condition_variable/tests/01-run.py index c92f48c64f..27414b15f1 100755 --- a/tests/cpp11_condition_variable/tests/01-run.py +++ b/tests/cpp11_condition_variable/tests/01-run.py @@ -24,6 +24,7 @@ def testfunc(child): child.expect_exact("Bye, bye.") child.expect_exact("******************************************************") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/cpp11_mutex/tests/01-run.py b/tests/cpp11_mutex/tests/01-run.py index 76bf11d9d7..9ab150730c 100755 --- a/tests/cpp11_mutex/tests/01-run.py +++ b/tests/cpp11_mutex/tests/01-run.py @@ -20,6 +20,7 @@ def testfunc(child): child.expect_exact("Bye, bye.") child.expect_exact("*****************************************") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/cpp11_thread/tests/01-run.py b/tests/cpp11_thread/tests/01-run.py index 98b91d1d4e..9a817e4b35 100755 --- a/tests/cpp11_thread/tests/01-run.py +++ b/tests/cpp11_thread/tests/01-run.py @@ -32,6 +32,7 @@ def testfunc(child): child.expect_exact("Bye, bye.") child.expect_exact("******************************************") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/driver_ds1307/tests/01-run.py b/tests/driver_ds1307/tests/01-run.py index b9d290dc4f..6ed2af7420 100755 --- a/tests/driver_ds1307/tests/01-run.py +++ b/tests/driver_ds1307/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect([r"OK \([0-9]+ tests\)", r"error: unable to initialize RTC \[I2C initialization error\]"]) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/driver_grove_ledbar/tests/01-run.py b/tests/driver_grove_ledbar/tests/01-run.py index 5b61fd1c99..c84b665d70 100755 --- a/tests/driver_grove_ledbar/tests/01-run.py +++ b/tests/driver_grove_ledbar/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect_exact(u"[SUCCESS]", timeout=60) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/driver_hd44780/tests/01-run.py b/tests/driver_hd44780/tests/01-run.py index 234d38d8b6..d1c960c926 100644 --- a/tests/driver_hd44780/tests/01-run.py +++ b/tests/driver_hd44780/tests/01-run.py @@ -15,6 +15,7 @@ def testfunc(child): child.expect_exact("[START]") child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/driver_my9221/tests/01-run.py b/tests/driver_my9221/tests/01-run.py index e5ee08c221..5294c8fff1 100755 --- a/tests/driver_my9221/tests/01-run.py +++ b/tests/driver_my9221/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect_exact("[SUCCESS]", timeout=60) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/events/tests/01-run.py b/tests/events/tests/01-run.py index fab469c905..2a924bfa85 100755 --- a/tests/events/tests/01-run.py +++ b/tests/events/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect_exact(u"[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/evtimer_msg/tests/01-run.py b/tests/evtimer_msg/tests/01-run.py index 6f8c0eee46..e6b253ca2c 100755 --- a/tests/evtimer_msg/tests/01-run.py +++ b/tests/evtimer_msg/tests/01-run.py @@ -28,6 +28,7 @@ def testfunc(child): print("") print("All tests successful") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/evtimer_underflow/tests/01-run.py b/tests/evtimer_underflow/tests/01-run.py index 60efd4d8da..8fc46bcedb 100755 --- a/tests/evtimer_underflow/tests/01-run.py +++ b/tests/evtimer_underflow/tests/01-run.py @@ -22,6 +22,7 @@ def testfunc(child): print("Stopped after %i iterations, but should run forever." % how_many) print("=> All tests successful") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/float/tests/01-run.py b/tests/float/tests/01-run.py index 0bef7e65cb..7147006321 100755 --- a/tests/float/tests/01-run.py +++ b/tests/float/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect_exact("Testing floating point arithmetics...") child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/fmt_print/tests/01-run.py b/tests/fmt_print/tests/01-run.py index 913500e1c7..1376bea5cc 100755 --- a/tests/fmt_print/tests/01-run.py +++ b/tests/fmt_print/tests/01-run.py @@ -8,6 +8,7 @@ def testfunc(child): child.expect_exact('If you can read this:') child.expect_exact('Test successful.') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_ipv6_ext/tests/01-run.py b/tests/gnrc_ipv6_ext/tests/01-run.py index 3a56e803ba..e6e1dca500 100755 --- a/tests/gnrc_ipv6_ext/tests/01-run.py +++ b/tests/gnrc_ipv6_ext/tests/01-run.py @@ -37,6 +37,7 @@ def testfunc(child): child.expect_exact("ipv6: forward nh = 17 to other threads") child.expect_exact("pkt->users: 0") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_ipv6_nib/tests/01-run.py b/tests/gnrc_ipv6_nib/tests/01-run.py index 741c695754..5335cd0ffd 100755 --- a/tests/gnrc_ipv6_nib/tests/01-run.py +++ b/tests/gnrc_ipv6_nib/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect(r"OK \(\d+ tests\)") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py index 741c695754..5335cd0ffd 100755 --- a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py +++ b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect(r"OK \(\d+ tests\)") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_ndp/tests/01-run.py b/tests/gnrc_ndp/tests/01-run.py index dcc3c5d7f6..abcdd5d742 100755 --- a/tests/gnrc_ndp/tests/01-run.py +++ b/tests/gnrc_ndp/tests/01-run.py @@ -15,6 +15,7 @@ def testfunc(child): # 1st 6LoWPAN fragment child.expect(r"OK \(\d+ tests\)") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_netif/tests/01-run.py b/tests/gnrc_netif/tests/01-run.py index 7901d4b7c0..007806d149 100755 --- a/tests/gnrc_netif/tests/01-run.py +++ b/tests/gnrc_netif/tests/01-run.py @@ -136,6 +136,7 @@ def testfunc(child): child.expect("dst_l2addr: 3e:e6:b5:22:fd:0a") child.expect("~~ PKT - 2 snips, total size: 61 byte") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_sixlowpan/tests/01-run.py b/tests/gnrc_sixlowpan/tests/01-run.py index 5138e34408..0d383b5d8c 100755 --- a/tests/gnrc_sixlowpan/tests/01-run.py +++ b/tests/gnrc_sixlowpan/tests/01-run.py @@ -74,6 +74,7 @@ def testfunc(child): child.expect_exact("source address: fe80::ff:fe00:2") child.expect_exact("destination address: fd01::1") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_sock_ip/tests/01-run.py b/tests/gnrc_sock_ip/tests/01-run.py index dfe4e3077f..1a1b9564c5 100755 --- a/tests/gnrc_sock_ip/tests/01-run.py +++ b/tests/gnrc_sock_ip/tests/01-run.py @@ -47,6 +47,7 @@ def testfunc(child): child.expect_exact(u"Calling test_sock_ip_send__no_sock()") child.expect_exact(u"ALL TESTS SUCCESSFUL") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/gnrc_sock_udp/tests/01-run.py b/tests/gnrc_sock_udp/tests/01-run.py index a91d62103f..3805eddb51 100755 --- a/tests/gnrc_sock_udp/tests/01-run.py +++ b/tests/gnrc_sock_udp/tests/01-run.py @@ -51,6 +51,7 @@ def testfunc(child): child.expect_exact(u"Calling test_sock_udp_send__no_sock()") child.expect_exact(u"ALL TESTS SUCCESSFUL") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/irq/tests/01-run.py b/tests/irq/tests/01-run.py index f5394a40b7..e0882108c8 100755 --- a/tests/irq/tests/01-run.py +++ b/tests/irq/tests/01-run.py @@ -8,6 +8,7 @@ def testfunc(child): child.expect('START') child.expect('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/libfixmath/tests/01-run.py b/tests/libfixmath/tests/01-run.py index 71916e93ea..806cbe31f7 100755 --- a/tests/libfixmath/tests/01-run.py +++ b/tests/libfixmath/tests/01-run.py @@ -37,6 +37,7 @@ def testfunc(child): expect_binary(child) child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/libfixmath_unittests/tests/01-run.py b/tests/libfixmath_unittests/tests/01-run.py index 737987663f..46ec14b312 100755 --- a/tests/libfixmath_unittests/tests/01-run.py +++ b/tests/libfixmath_unittests/tests/01-run.py @@ -13,6 +13,7 @@ import sys def testfunc(child): child.expect('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/lwip/tests/01-run.py b/tests/lwip/tests/01-run.py index f4e218bad8..652455ccff 100755 --- a/tests/lwip/tests/01-run.py +++ b/tests/lwip/tests/01-run.py @@ -307,6 +307,7 @@ def test_triple_send(board_group, application, env=None): sender.expect_exact(u"Success: send 4 byte over TCP to server") receiver.expect(u"00000000 DE AD BE EF") + if __name__ == "__main__": TestStrategy().execute([BoardGroup((Board("native", "tap0"), Board("native", "tap1")))], diff --git a/tests/lwip_sock_ip/tests/01-run.py b/tests/lwip_sock_ip/tests/01-run.py index 36cd5a0a83..c42a8a5da7 100755 --- a/tests/lwip_sock_ip/tests/01-run.py +++ b/tests/lwip_sock_ip/tests/01-run.py @@ -95,6 +95,7 @@ def testfunc(child): child.expect_exact(u"Calling test_sock_ip_send6__no_sock()") child.expect_exact(u"ALL TESTS SUCCESSFUL") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/lwip_sock_tcp/tests/01-run.py b/tests/lwip_sock_tcp/tests/01-run.py index 5ceb51e3e2..b6accd3911 100755 --- a/tests/lwip_sock_tcp/tests/01-run.py +++ b/tests/lwip_sock_tcp/tests/01-run.py @@ -89,6 +89,7 @@ def testfunc(child): child.expect_exact("Calling test_tcp_write6__success()") child.expect_exact(u"ALL TESTS SUCCESSFUL") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/lwip_sock_udp/tests/01-run.py b/tests/lwip_sock_udp/tests/01-run.py index 7cbc8007b3..931602586e 100755 --- a/tests/lwip_sock_udp/tests/01-run.py +++ b/tests/lwip_sock_udp/tests/01-run.py @@ -107,6 +107,7 @@ def testfunc(child): child.expect_exact(u"Calling test_sock_udp_send6__no_sock()") child.expect_exact(u"ALL TESTS SUCCESSFUL") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/msg_avail/tests/01-run.py b/tests/msg_avail/tests/01-run.py index fab469c905..2a924bfa85 100755 --- a/tests/msg_avail/tests/01-run.py +++ b/tests/msg_avail/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect_exact(u"[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/msg_send_receive/tests/01-run.py b/tests/msg_send_receive/tests/01-run.py index 26a28d1a2d..5fded2dae6 100755 --- a/tests/msg_send_receive/tests/01-run.py +++ b/tests/msg_send_receive/tests/01-run.py @@ -13,6 +13,7 @@ import sys def testfunc(child): child.expect(u"Test successful.") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/msg_try_receive/tests/01-run.py b/tests/msg_try_receive/tests/01-run.py index d69458c3f6..743b29a433 100755 --- a/tests/msg_try_receive/tests/01-run.py +++ b/tests/msg_try_receive/tests/01-run.py @@ -8,6 +8,7 @@ def testfunc(child): child.expect('main starting') child.expect('msg available: 1 \(should be 1\!\)') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/mutex_order/tests/01-run.py b/tests/mutex_order/tests/01-run.py index 4dbeb32959..048a9dbe6b 100755 --- a/tests/mutex_order/tests/01-run.py +++ b/tests/mutex_order/tests/01-run.py @@ -29,6 +29,7 @@ def testfunc(child): assert(int(child.match.group(1)) > last) last = int(child.match.group(1)) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/mutex_unlock_and_sleep/tests/01-run.py b/tests/mutex_unlock_and_sleep/tests/01-run.py index 632c66ab10..f02f97644b 100755 --- a/tests/mutex_unlock_and_sleep/tests/01-run.py +++ b/tests/mutex_unlock_and_sleep/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): for i in range(20): child.expect(r"\[ALIVE\] alternated \d+k times.") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/netdev_test/tests/01-run.py b/tests/netdev_test/tests/01-run.py index 615046f432..60b6ababd8 100755 --- a/tests/netdev_test/tests/01-run.py +++ b/tests/netdev_test/tests/01-run.py @@ -21,6 +21,7 @@ def testfunc(child): child.expect_exact(' + succeeded.') child.expect_exact('ALL TESTS SUCCESSFUL') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/netstats_l2/tests/01-run.py b/tests/netstats_l2/tests/01-run.py index ee0e4e38f4..c31495c6b0 100755 --- a/tests/netstats_l2/tests/01-run.py +++ b/tests/netstats_l2/tests/01-run.py @@ -18,6 +18,7 @@ def testfunc(child): child.expect(r' TX packets \d+ \(Multicast: \d+\) bytes \d+') child.expect(r' TX succeeded \d+ errors \d+') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/nhdp/tests/01-run.py b/tests/nhdp/tests/01-run.py index ee451a7d3c..a46a94f02c 100755 --- a/tests/nhdp/tests/01-run.py +++ b/tests/nhdp/tests/01-run.py @@ -13,6 +13,7 @@ import sys def testfunc(child): child.expect_exact('SUCCESS: NHDP compiled!') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/od/tests/01-run.py b/tests/od/tests/01-run.py index d99d4300ae..ab3fe4e95e 100755 --- a/tests/od/tests/01-run.py +++ b/tests/od/tests/01-run.py @@ -38,6 +38,7 @@ def testfunc(child): print("All tests successful") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/od/tests/02-run.py b/tests/od/tests/02-run.py index 3e99f59b9b..d16afbf34a 100755 --- a/tests/od/tests/02-run.py +++ b/tests/od/tests/02-run.py @@ -38,6 +38,7 @@ def testfunc(child): print("All tests successful") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/periph_timer/tests/01-run.py b/tests/periph_timer/tests/01-run.py index 5e6a8f7cd0..cdf9c11ebe 100755 --- a/tests/periph_timer/tests/01-run.py +++ b/tests/periph_timer/tests/01-run.py @@ -20,6 +20,7 @@ def testfunc(child): child.expect_exact('TIMER_{}: starting'.format(timer)) child.expect('TEST SUCCEEDED') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pipe/tests/01-run.py b/tests/pipe/tests/01-run.py index 8965b5a720..27cc8421b9 100755 --- a/tests/pipe/tests/01-run.py +++ b/tests/pipe/tests/01-run.py @@ -28,6 +28,7 @@ def testfunc(child): child.expect_exact('End read: [24:26]') child.expect_exact('End done.') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_jsmn/tests/01-run.py b/tests/pkg_jsmn/tests/01-run.py index c5e46800e7..c6809554cc 100755 --- a/tests/pkg_jsmn/tests/01-run.py +++ b/tests/pkg_jsmn/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect_exact(' * audio') child.expect_exact(' * video') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_libcoap/tests/01-run.py b/tests/pkg_libcoap/tests/01-run.py index dd4a7748f4..5585a69c77 100755 --- a/tests/pkg_libcoap/tests/01-run.py +++ b/tests/pkg_libcoap/tests/01-run.py @@ -7,6 +7,7 @@ import sys def testfunc(child): child.expect_exact('SUCCESS: Libcoap compiled!') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run 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 4118445bca..4972ee4e99 100755 --- a/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py +++ b/tests/pkg_micro-ecc-with-hwrng/tests/01-run.py @@ -11,6 +11,7 @@ def testfunc(child): child.expect_exact('................ done with 0 error(s)') child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_micro-ecc/tests/01-run.py b/tests/pkg_micro-ecc/tests/01-run.py index 513681ac13..3ac2468653 100755 --- a/tests/pkg_micro-ecc/tests/01-run.py +++ b/tests/pkg_micro-ecc/tests/01-run.py @@ -11,6 +11,7 @@ def testfunc(child): child.expect_exact('................ done with 0 error(s)') child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_minmea/tests/01-run.py b/tests/pkg_minmea/tests/01-run.py index dc6d8b5472..3d845b9542 100755 --- a/tests/pkg_minmea/tests/01-run.py +++ b/tests/pkg_minmea/tests/01-run.py @@ -8,6 +8,7 @@ def testfunc(child): child.expect_exact('START') child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_tiny-asn1/tests/01-run.py b/tests/pkg_tiny-asn1/tests/01-run.py index 674ed5a8ed..21c0545f52 100755 --- a/tests/pkg_tiny-asn1/tests/01-run.py +++ b/tests/pkg_tiny-asn1/tests/01-run.py @@ -14,6 +14,7 @@ import sys def testfunc(child): child.expect('Decoding finished succesfully') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_u8g2/tests/01-run.py b/tests/pkg_u8g2/tests/01-run.py index a8000938a8..0f092935e2 100755 --- a/tests/pkg_u8g2/tests/01-run.py +++ b/tests/pkg_u8g2/tests/01-run.py @@ -69,6 +69,7 @@ def testfunc(child): for line in EXPECTED_STDOUT: child.expect_exact(line) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pkg_umorse/tests/01-run.py b/tests/pkg_umorse/tests/01-run.py index b3fe164f1e..d6f6bf65e5 100755 --- a/tests/pkg_umorse/tests/01-run.py +++ b/tests/pkg_umorse/tests/01-run.py @@ -19,6 +19,7 @@ def testfunc(child): child.expect_exact("[SUCCESS]", timeout=120) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/posix_semaphore/tests/01-run.py b/tests/posix_semaphore/tests/01-run.py index cb5bf3a01b..45d7bb23a7 100755 --- a/tests/posix_semaphore/tests/01-run.py +++ b/tests/posix_semaphore/tests/01-run.py @@ -96,6 +96,7 @@ def testfunc(child): test4(child) child.expect("######################### DONE") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/posix_time/tests/01-run.py b/tests/posix_time/tests/01-run.py index 324ea3393d..1bc62b9926 100755 --- a/tests/posix_time/tests/01-run.py +++ b/tests/posix_time/tests/01-run.py @@ -44,6 +44,7 @@ def testfunc(child): print(e) sys.exit(1) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/ps_schedstatistics/tests/01-run.py b/tests/ps_schedstatistics/tests/01-run.py index 5d76f3d608..48448c2807 100755 --- a/tests/ps_schedstatistics/tests/01-run.py +++ b/tests/ps_schedstatistics/tests/01-run.py @@ -58,6 +58,7 @@ def testfunc(child): _check_help(child) _check_ps(child) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/pthread_tls/tests/01-run.py b/tests/pthread_tls/tests/01-run.py index 004395d4e0..2ea9d9893f 100755 --- a/tests/pthread_tls/tests/01-run.py +++ b/tests/pthread_tls/tests/01-run.py @@ -34,6 +34,7 @@ def testfunc(child): child.expect('tls tests finished.') child.expect('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/rmutex/tests/01-run.py b/tests/rmutex/tests/01-run.py index a68a109ce7..669015f36f 100755 --- a/tests/rmutex/tests/01-run.py +++ b/tests/rmutex/tests/01-run.py @@ -43,6 +43,7 @@ def testfunc(child): child.expect(u"T%i \(prio %i, depth %i\): locked rmutex now" % (T, thread_prio[T], depth)) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/sched_testing/tests/01-run.py b/tests/sched_testing/tests/01-run.py index c383d79011..17abd6b816 100755 --- a/tests/sched_testing/tests/01-run.py +++ b/tests/sched_testing/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect_exact('yield 2') child.expect_exact('done') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/shell/tests/01-run.py b/tests/shell/tests/01-run.py index c2e309f654..f67aa8c819 100755 --- a/tests/shell/tests/01-run.py +++ b/tests/shell/tests/01-run.py @@ -54,6 +54,7 @@ def testfunc(child): for cmd, expected in CMDS.items(): check_cmd(child, cmd, expected) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/sizeof_tcb/tests/01-run.py b/tests/sizeof_tcb/tests/01-run.py index 831ee218ac..9151e83d87 100755 --- a/tests/sizeof_tcb/tests/01-run.py +++ b/tests/sizeof_tcb/tests/01-run.py @@ -24,6 +24,7 @@ def testfunc(child): child.expect_exact('\tmsg_array 4 32') child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/ssp/tests/01-run.py b/tests/ssp/tests/01-run.py index 8b5334ff8a..604ea034c6 100755 --- a/tests/ssp/tests/01-run.py +++ b/tests/ssp/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect_exact('calling stack corruption function') child.expect('.*stack smashing detected.*') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/struct_tm_utility/tests/01-run.py b/tests/struct_tm_utility/tests/01-run.py index 91fa7fa489..10c78eafcc 100755 --- a/tests/struct_tm_utility/tests/01-run.py +++ b/tests/struct_tm_utility/tests/01-run.py @@ -112,6 +112,7 @@ def testfunc(child): _check_doomsday(child) _check_day(child) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/thread_basic/tests/01-run.py b/tests/thread_basic/tests/01-run.py index 74e3fcd77a..1b98ddde0c 100755 --- a/tests/thread_basic/tests/01-run.py +++ b/tests/thread_basic/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect('first thread\r\n') child.expect('second thread\r\n') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/thread_cooperation/tests/01-run.py b/tests/thread_cooperation/tests/01-run.py index 84bcbbb0d9..a39fff35fb 100755 --- a/tests/thread_cooperation/tests/01-run.py +++ b/tests/thread_cooperation/tests/01-run.py @@ -16,6 +16,7 @@ def testfunc(child): child.expect(r"MAIN: \d+! = \d+") child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/thread_flood/tests/01-run.py b/tests/thread_flood/tests/01-run.py index 7e7cb55860..752bd40064 100755 --- a/tests/thread_flood/tests/01-run.py +++ b/tests/thread_flood/tests/01-run.py @@ -9,6 +9,7 @@ def testfunc(child): child.expect(r'\.+') child.expect(r'\[SUCCESS\] created \d+') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/thread_msg/tests/01-run.py b/tests/thread_msg/tests/01-run.py index 57d9f326e5..bb96337064 100755 --- a/tests/thread_msg/tests/01-run.py +++ b/tests/thread_msg/tests/01-run.py @@ -12,6 +12,7 @@ def testfunc(child): child.expect_exact('THREAD 1 end') child.expect_exact('SUCCESS') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run 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 3ab9705cbf..0854f15cb8 100755 --- a/tests/thread_msg_block_w_queue/tests/01-run.py +++ b/tests/thread_msg_block_w_queue/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect('sender_thread start\r\n') child.expect('main thread alive\r\n') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run 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 3ab9705cbf..0854f15cb8 100755 --- a/tests/thread_msg_block_wo_queue/tests/01-run.py +++ b/tests/thread_msg_block_wo_queue/tests/01-run.py @@ -14,6 +14,7 @@ def testfunc(child): child.expect('sender_thread start\r\n') child.expect('main thread alive\r\n') + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/trickle/tests/01-run.py b/tests/trickle/tests/01-run.py index 47afeebe73..5e2ad97afb 100755 --- a/tests/trickle/tests/01-run.py +++ b/tests/trickle/tests/01-run.py @@ -23,6 +23,7 @@ def testfunc(child): child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/unittests/tests/01-run.py b/tests/unittests/tests/01-run.py index 48b7ac912e..91c513a2bf 100755 --- a/tests/unittests/tests/01-run.py +++ b/tests/unittests/tests/01-run.py @@ -13,6 +13,7 @@ import sys def testfunc(child): child.expect(u"OK \\([0-9]+ tests\\)") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/warn_conflict/tests/01-make.py b/tests/warn_conflict/tests/01-make.py index 29961ba8ce..a82a2b2614 100755 --- a/tests/warn_conflict/tests/01-make.py +++ b/tests/warn_conflict/tests/01-make.py @@ -45,5 +45,6 @@ def testfunc(): finally: child.close() + if __name__ == '__main__': testfunc() diff --git a/tests/xtimer_hang/tests/01-run.py b/tests/xtimer_hang/tests/01-run.py index 68676388e2..2ef612c3a6 100755 --- a/tests/xtimer_hang/tests/01-run.py +++ b/tests/xtimer_hang/tests/01-run.py @@ -20,6 +20,7 @@ def testfunc(child): child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_msg_receive_timeout/tests/01-run.py b/tests/xtimer_msg_receive_timeout/tests/01-run.py index 2de740b507..c54de66bb8 100755 --- a/tests/xtimer_msg_receive_timeout/tests/01-run.py +++ b/tests/xtimer_msg_receive_timeout/tests/01-run.py @@ -17,6 +17,7 @@ def testfunc(child): child.expect("Timeout!") child.expect("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_now64_continuity/tests/01-run.py b/tests/xtimer_now64_continuity/tests/01-run.py index 471c537dab..bf08342222 100755 --- a/tests/xtimer_now64_continuity/tests/01-run.py +++ b/tests/xtimer_now64_continuity/tests/01-run.py @@ -15,6 +15,7 @@ def testfunc(child): child.expect(u"\[RESULTS\] min=\d+, avg=\d+, max=\d+") child.expect_exact("[SUCCESS]") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_periodic_wakeup/tests/01-run.py b/tests/xtimer_periodic_wakeup/tests/01-run.py index 6012617a75..6f243b1bdd 100755 --- a/tests/xtimer_periodic_wakeup/tests/01-run.py +++ b/tests/xtimer_periodic_wakeup/tests/01-run.py @@ -21,6 +21,7 @@ def testfunc(child): child.expect(u"Min/max error: \d+/\d+") child.expect_exact("Test complete.") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_remove/tests/01-run.py b/tests/xtimer_remove/tests/01-run.py index 56dfa19f28..5f964eb1be 100755 --- a/tests/xtimer_remove/tests/01-run.py +++ b/tests/xtimer_remove/tests/01-run.py @@ -23,6 +23,7 @@ def testfunc(child): child.expect_exact("timer 1 triggered.") child.expect_exact("test successful.") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_reset/tests/01-run.py b/tests/xtimer_reset/tests/01-run.py index 11af527564..911073c2b8 100755 --- a/tests/xtimer_reset/tests/01-run.py +++ b/tests/xtimer_reset/tests/01-run.py @@ -19,6 +19,7 @@ def testfunc(child): child.expect(u"now=\d+") child.expect_exact("Test completed!") + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_usleep/tests/01-run.py b/tests/xtimer_usleep/tests/01-run.py index 01c5fc6c3b..74ba91d31d 100755 --- a/tests/xtimer_usleep/tests/01-run.py +++ b/tests/xtimer_usleep/tests/01-run.py @@ -51,6 +51,7 @@ def testfunc(child): print(e) sys.exit(1) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run diff --git a/tests/xtimer_usleep_short/tests/01-run.py b/tests/xtimer_usleep_short/tests/01-run.py index fb43acd748..815c166e0d 100755 --- a/tests/xtimer_usleep_short/tests/01-run.py +++ b/tests/xtimer_usleep_short/tests/01-run.py @@ -27,6 +27,7 @@ def testfunc(child): child.expect(u"[SUCCESS]", timeout=3) + if __name__ == "__main__": sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) from testrunner import run