From e9af3101595bed31e878e7d08da37b000ae1306d Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 12 Mar 2020 13:43:10 +0100 Subject: [PATCH] tests: use check_unittests func from testrunner --- tests/cpp_ctors/tests/01-run.py | 8 ++------ tests/devfs/tests/01-run.py | 8 ++------ tests/embunit/tests/01-run.py | 8 ++------ tests/gnrc_ipv6_ext_frag/tests/01-run.py | 4 ++-- tests/gnrc_ipv6_nib/tests/01-run.py | 8 ++------ tests/gnrc_ipv6_nib_6ln/tests/01-run.py | 8 ++------ tests/gnrc_ndp/tests/01-run.py | 9 ++------- tests/gnrc_netif/tests/01-run.py | 4 ++-- tests/gnrc_rpl_srh/tests/01-run.py | 4 ++-- tests/gnrc_sixlowpan_frag/tests/01-run.py | 8 ++------ tests/gnrc_sixlowpan_iphc_w_vrb/tests/01-run.py | 4 ++-- tests/l2util/tests/01-run.py | 8 ++------ tests/libc_newlib/tests/01-run.py | 8 ++------ tests/mtd_flashpage/tests/01-run.py | 8 ++------ tests/mtd_mapper/tests/01-run.py | 8 ++------ tests/pkg_cifra/tests/01-run.py | 8 ++------ tests/pkg_cn-cbor/tests/01-run.py | 8 ++------ tests/pkg_hacl/tests/01-run.py | 8 ++------ tests/pkg_heatshrink/tests/01-run.py | 8 ++------ tests/pkg_libb2/tests/01-run.py | 8 ++------ tests/pkg_libhydrogen/tests/01-run.py | 8 ++------ tests/pkg_littlefs/tests/01-run.py | 8 ++------ tests/pkg_littlefs2/tests/01-run.py | 8 ++------ tests/pkg_monocypher/tests/01-run.py | 8 ++------ tests/pkg_nanocbor/tests/01-run.py | 8 ++------ tests/pkg_qcbor/tests/01-run.py | 8 ++------ tests/pkg_qdsa/tests/01-run.py | 8 ++------ tests/pkg_relic/tests/01-run.py | 7 +++---- tests/pkg_spiffs/tests/01-run.py | 8 ++------ tests/pkg_tinycbor/tests/01-run.py | 8 ++------ tests/pkg_yxml/tests/01-run.py | 8 ++------ tests/riotboot_hdr/tests/01-run.py | 8 ++------ tests/sys_crypto/tests/01-run.py | 8 ++------ tests/unittests/tests/01-run.py | 7 +++---- tests/usbus/tests/01-run.py | 11 ++--------- 35 files changed, 72 insertions(+), 194 deletions(-) diff --git a/tests/cpp_ctors/tests/01-run.py b/tests/cpp_ctors/tests/01-run.py index 1dcdd41c14..aec47345a2 100755 --- a/tests/cpp_ctors/tests/01-run.py +++ b/tests/cpp_ctors/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/devfs/tests/01-run.py b/tests/devfs/tests/01-run.py index 1dcdd41c14..aec47345a2 100755 --- a/tests/devfs/tests/01-run.py +++ b/tests/devfs/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/embunit/tests/01-run.py b/tests/embunit/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/embunit/tests/01-run.py +++ b/tests/embunit/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/gnrc_ipv6_ext_frag/tests/01-run.py b/tests/gnrc_ipv6_ext_frag/tests/01-run.py index 3308737686..e753661631 100755 --- a/tests/gnrc_ipv6_ext_frag/tests/01-run.py +++ b/tests/gnrc_ipv6_ext_frag/tests/01-run.py @@ -16,7 +16,7 @@ import time from scapy.all import Ether, ICMPv6PacketTooBig, IPv6, IPv6ExtHdrFragment, \ UDP, raw, sendp, srp1 -from testrunner import run +from testrunner import run, check_unittests RECV_BUFSIZE = 2 * 1500 @@ -319,7 +319,7 @@ def testfunc(child): tap = get_bridge(os.environ["TAP"]) child.sendline("unittests") - child.expect(r"OK \((\d+) tests\)") # wait for and check result of unittests + check_unittests(child) # wait for and check result of unittests print("." * int(child.match.group(1)), end="", flush=True) lladdr_src = get_host_lladdr(tap) diff --git a/tests/gnrc_ipv6_nib/tests/01-run.py b/tests/gnrc_ipv6_nib/tests/01-run.py index 6d8b056e2d..2eac21932f 100755 --- a/tests/gnrc_ipv6_nib/tests/01-run.py +++ b/tests/gnrc_ipv6_nib/tests/01-run.py @@ -8,12 +8,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \(\d+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py index 6d8b056e2d..2eac21932f 100755 --- a/tests/gnrc_ipv6_nib_6ln/tests/01-run.py +++ b/tests/gnrc_ipv6_nib_6ln/tests/01-run.py @@ -8,12 +8,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \(\d+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/gnrc_ndp/tests/01-run.py b/tests/gnrc_ndp/tests/01-run.py index 022ebe7a89..2eac21932f 100755 --- a/tests/gnrc_ndp/tests/01-run.py +++ b/tests/gnrc_ndp/tests/01-run.py @@ -8,13 +8,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - # 1st 6LoWPAN fragment - child.expect(r"OK \(\d+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/gnrc_netif/tests/01-run.py b/tests/gnrc_netif/tests/01-run.py index 314dcdd8c8..b434a41023 100755 --- a/tests/gnrc_netif/tests/01-run.py +++ b/tests/gnrc_netif/tests/01-run.py @@ -8,12 +8,12 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run, check_unittests def testfunc(child): # embUnit tests - child.expect(r"OK \(\d+ tests\)") + check_unittests(child) # output cross-checked hex data with WireShark -> "Import from Hex Dump..." # test_netapi_send__raw_unicast_ethernet_packet child.expect("Sending data from Ethernet device:") diff --git a/tests/gnrc_rpl_srh/tests/01-run.py b/tests/gnrc_rpl_srh/tests/01-run.py index eb566e8053..d7276ae709 100755 --- a/tests/gnrc_rpl_srh/tests/01-run.py +++ b/tests/gnrc_rpl_srh/tests/01-run.py @@ -18,7 +18,7 @@ from scapy.all import Ether, IPv6, UDP, \ IPv6ExtHdrFragment, IPv6ExtHdrRouting, \ ICMPv6ParamProblem, ICMPv6TimeExceeded, \ sendp, srp1, sniff -from testrunner import run +from testrunner import run, check_unittests EXT_HDR_NH = { @@ -338,7 +338,7 @@ def testfunc(child): global sniffer tap = get_bridge(os.environ["TAP"]) child.sendline("unittests") - child.expect(r"OK \((\d+) tests\)") # wait for and check result of unittests + check_unittests(child) # wait for and check result of unittests print("." * int(child.match.group(1)), end="", flush=True) lladdr_src = get_host_lladdr(tap) child.sendline("ifconfig") diff --git a/tests/gnrc_sixlowpan_frag/tests/01-run.py b/tests/gnrc_sixlowpan_frag/tests/01-run.py index 1dcdd41c14..aec47345a2 100755 --- a/tests/gnrc_sixlowpan_frag/tests/01-run.py +++ b/tests/gnrc_sixlowpan_frag/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/gnrc_sixlowpan_iphc_w_vrb/tests/01-run.py b/tests/gnrc_sixlowpan_iphc_w_vrb/tests/01-run.py index f6bb07dcc4..20086caf3b 100755 --- a/tests/gnrc_sixlowpan_iphc_w_vrb/tests/01-run.py +++ b/tests/gnrc_sixlowpan_iphc_w_vrb/tests/01-run.py @@ -7,7 +7,7 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run, check_unittests def testfunc(child): @@ -88,7 +88,7 @@ def testfunc(child): ) child.expect_exact("Original fragmentation header:") child.expect_exact("IPHC headers + payload:") - child.expect(r"OK \((\d+) tests\)") + check_unittests(child) assert int(child.match.group(1)) >= 4 diff --git a/tests/l2util/tests/01-run.py b/tests/l2util/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/l2util/tests/01-run.py +++ b/tests/l2util/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/libc_newlib/tests/01-run.py b/tests/libc_newlib/tests/01-run.py index 5aedfe8869..3fe2e63b5b 100755 --- a/tests/libc_newlib/tests/01-run.py +++ b/tests/libc_newlib/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \([0-9]+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/mtd_flashpage/tests/01-run.py b/tests/mtd_flashpage/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/mtd_flashpage/tests/01-run.py +++ b/tests/mtd_flashpage/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/mtd_mapper/tests/01-run.py b/tests/mtd_mapper/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/mtd_mapper/tests/01-run.py +++ b/tests/mtd_mapper/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_cifra/tests/01-run.py b/tests/pkg_cifra/tests/01-run.py index 6d8b056e2d..2eac21932f 100755 --- a/tests/pkg_cifra/tests/01-run.py +++ b/tests/pkg_cifra/tests/01-run.py @@ -8,12 +8,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \(\d+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_cn-cbor/tests/01-run.py b/tests/pkg_cn-cbor/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_cn-cbor/tests/01-run.py +++ b/tests/pkg_cn-cbor/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_hacl/tests/01-run.py b/tests/pkg_hacl/tests/01-run.py index 13d2f3f606..f3765d52ad 100755 --- a/tests/pkg_hacl/tests/01-run.py +++ b/tests/pkg_hacl/tests/01-run.py @@ -7,7 +7,7 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run_check_unittests # increase the default timeout to 30s, on samr30-xpro this test takes 20s to @@ -15,9 +15,5 @@ from testrunner import run TIMEOUT = 30 -def testfunc(child): - child.expect(r'OK \(\d+ tests\)', timeout=TIMEOUT) - - if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(timeout=TIMEOUT)) diff --git a/tests/pkg_heatshrink/tests/01-run.py b/tests/pkg_heatshrink/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_heatshrink/tests/01-run.py +++ b/tests/pkg_heatshrink/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_libb2/tests/01-run.py b/tests/pkg_libb2/tests/01-run.py index 36a1bc15fc..3f9446b956 100755 --- a/tests/pkg_libb2/tests/01-run.py +++ b/tests/pkg_libb2/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect_exact('OK (2 tests)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(nb_tests=2)) diff --git a/tests/pkg_libhydrogen/tests/01-run.py b/tests/pkg_libhydrogen/tests/01-run.py index a9078c0d97..8b4e23f2e7 100755 --- a/tests/pkg_libhydrogen/tests/01-run.py +++ b/tests/pkg_libhydrogen/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect_exact('OK (3 tests)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_littlefs/tests/01-run.py b/tests/pkg_littlefs/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_littlefs/tests/01-run.py +++ b/tests/pkg_littlefs/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_littlefs2/tests/01-run.py b/tests/pkg_littlefs2/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_littlefs2/tests/01-run.py +++ b/tests/pkg_littlefs2/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_monocypher/tests/01-run.py b/tests/pkg_monocypher/tests/01-run.py index d50e5ce468..558a656098 100755 --- a/tests/pkg_monocypher/tests/01-run.py +++ b/tests/pkg_monocypher/tests/01-run.py @@ -8,7 +8,7 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run_check_unittests # increase the default timeout to 20s, on samr30-xpro this test takes 14s to @@ -16,9 +16,5 @@ from testrunner import run TIMEOUT = 20 -def testfunc(child): - child.expect(r"OK \(2 tests\)", timeout=TIMEOUT) - - if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(timeout=TIMEOUT, nb_tests=2)) diff --git a/tests/pkg_nanocbor/tests/01-run.py b/tests/pkg_nanocbor/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_nanocbor/tests/01-run.py +++ b/tests/pkg_nanocbor/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_qcbor/tests/01-run.py b/tests/pkg_qcbor/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_qcbor/tests/01-run.py +++ b/tests/pkg_qcbor/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_qdsa/tests/01-run.py b/tests/pkg_qdsa/tests/01-run.py index b276fc579b..39135370a0 100755 --- a/tests/pkg_qdsa/tests/01-run.py +++ b/tests/pkg_qdsa/tests/01-run.py @@ -7,15 +7,11 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run_check_unittests # It takes ~11s on nucleo-l152re, so add some margin TIMEOUT = 15 -def testfunc(child): - child.expect(r'OK \(\d+ tests\)', timeout=TIMEOUT) - - if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(timeout=TIMEOUT)) diff --git a/tests/pkg_relic/tests/01-run.py b/tests/pkg_relic/tests/01-run.py index 81d82a82ff..4fcd8f9ff1 100755 --- a/tests/pkg_relic/tests/01-run.py +++ b/tests/pkg_relic/tests/01-run.py @@ -7,12 +7,11 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run_check_unittests -def testfunc(child): - child.expect(r'OK \(\d+ tests\)', timeout=120) +TIMEOUT = 120 if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(timeout=TIMEOUT)) diff --git a/tests/pkg_spiffs/tests/01-run.py b/tests/pkg_spiffs/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_spiffs/tests/01-run.py +++ b/tests/pkg_spiffs/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/pkg_tinycbor/tests/01-run.py b/tests/pkg_tinycbor/tests/01-run.py index b4cf24f637..5e7cc1a226 100755 --- a/tests/pkg_tinycbor/tests/01-run.py +++ b/tests/pkg_tinycbor/tests/01-run.py @@ -8,12 +8,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \(1 tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(nb_tests=1)) diff --git a/tests/pkg_yxml/tests/01-run.py b/tests/pkg_yxml/tests/01-run.py index 5fc8788f24..8b4e23f2e7 100755 --- a/tests/pkg_yxml/tests/01-run.py +++ b/tests/pkg_yxml/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/riotboot_hdr/tests/01-run.py b/tests/riotboot_hdr/tests/01-run.py index 8d71a331ef..2bdfc14fad 100755 --- a/tests/riotboot_hdr/tests/01-run.py +++ b/tests/riotboot_hdr/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r"OK \(\d+ tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/sys_crypto/tests/01-run.py b/tests/sys_crypto/tests/01-run.py index 1dcdd41c14..aec47345a2 100755 --- a/tests/sys_crypto/tests/01-run.py +++ b/tests/sys_crypto/tests/01-run.py @@ -7,12 +7,8 @@ # directory for more details. import sys -from testrunner import run - - -def testfunc(child): - child.expect(r'OK \(\d+ tests\)') +from testrunner import run_check_unittests if __name__ == "__main__": - sys.exit(run(testfunc)) + sys.exit(run_check_unittests()) diff --git a/tests/unittests/tests/01-run.py b/tests/unittests/tests/01-run.py index 5ba9b468a2..c6efce72c5 100755 --- a/tests/unittests/tests/01-run.py +++ b/tests/unittests/tests/01-run.py @@ -7,12 +7,11 @@ # directory for more details. import sys -from testrunner import run +from testrunner import run_check_unittests -def testfunc(child): - child.expect(u"OK \\([0-9]+ tests\\)") +TIMEOUT = 120 if __name__ == "__main__": - sys.exit(run(testfunc, timeout=120)) + sys.exit(run_check_unittests(timeout=TIMEOUT)) diff --git a/tests/usbus/tests/01-run.py b/tests/usbus/tests/01-run.py index 87ed1fce48..5e7cc1a226 100755 --- a/tests/usbus/tests/01-run.py +++ b/tests/usbus/tests/01-run.py @@ -7,16 +7,9 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. -import os import sys - - -def testfunc(child): - child.expect(r"OK \(1 tests\)") +from testrunner import run_check_unittests if __name__ == "__main__": - sys.path.append(os.path.join(os.environ['RIOTBASE'], - 'dist/tools/testrunner')) - from testrunner import run - sys.exit(run(testfunc)) + sys.exit(run_check_unittests(nb_tests=1))