1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests: use check_unittests func from testrunner

This commit is contained in:
Alexandre Abadie 2020-03-12 13:43:10 +01:00
parent fb643b348b
commit e9af310159
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
35 changed files with 72 additions and 194 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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