tests: fix python style 'E302 expected 2 blank lines, found 1'
This commit is contained in:
parent
071d9c2d7f
commit
c4f66edba1
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("Start.")
|
child.expect_exact("Start.")
|
||||||
child.expect('\+ bitarithm_msb: \d+ iterations per second')
|
child.expect('\+ bitarithm_msb: \d+ iterations per second')
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("Testing Bloom filter.")
|
child.expect_exact("Testing Bloom filter.")
|
||||||
child.expect_exact("m: 4096 k: 8")
|
child.expect_exact("m: 4096 k: 8")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("On-board button test")
|
child.expect_exact("On-board button test")
|
||||||
index = child.expect([
|
index = child.expect([
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import testrunner
|
|||||||
|
|
||||||
ACCEPTED_ERROR = 20
|
ACCEPTED_ERROR = 20
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact('Data:')
|
child.expect_exact('Data:')
|
||||||
child.expect_exact('(uint64_t, 1)')
|
child.expect_exact('(uint64_t, 1)')
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
def testfunc(child):
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
child.expect_exact("************ C++ condition_variable test ***********")
|
child.expect_exact("************ C++ condition_variable test ***********")
|
||||||
child.expect_exact("Wait with predicate and notify one ...")
|
child.expect_exact("Wait with predicate and notify one ...")
|
||||||
child.expect_exact("Done")
|
child.expect_exact("Done")
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
def testfunc(child):
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
child.expect_exact("************ C++ mutex test ***********")
|
child.expect_exact("************ C++ mutex test ***********")
|
||||||
child.expect_exact("Lock and unlock ...")
|
child.expect_exact("Lock and unlock ...")
|
||||||
child.expect_exact("Done")
|
child.expect_exact("Done")
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
def testfunc(child):
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
child.expect_exact("************ C++ thread test ***********")
|
child.expect_exact("************ C++ thread test ***********")
|
||||||
child.expect_exact("Creating one thread and passing an argument ...")
|
child.expect_exact("Creating one thread and passing an argument ...")
|
||||||
child.expect_exact("Done")
|
child.expect_exact("Done")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect([r"OK \([0-9]+ tests\)",
|
child.expect([r"OK \([0-9]+ tests\)",
|
||||||
r"error: unable to initialize RTC \[I2C initialization error\]"])
|
r"error: unable to initialize RTC \[I2C initialization error\]"])
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"[SUCCESS]", timeout=60)
|
child.expect_exact(u"[SUCCESS]", timeout=60)
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("[START]")
|
child.expect_exact("[START]")
|
||||||
child.expect_exact("[SUCCESS]")
|
child.expect_exact("[SUCCESS]")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("[SUCCESS]", timeout=60)
|
child.expect_exact("[SUCCESS]", timeout=60)
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"[SUCCESS]")
|
child.expect_exact(u"[SUCCESS]")
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import testrunner
|
|||||||
|
|
||||||
ACCEPTED_ERROR = 20
|
ACCEPTED_ERROR = 20
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(r"Testing generic evtimer \(start time = (\d+) ms\)")
|
child.expect(r"Testing generic evtimer \(start time = (\d+) ms\)")
|
||||||
timer_offset = int(child.match.group(1))
|
timer_offset = int(child.match.group(1))
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import testrunner
|
|||||||
|
|
||||||
how_many = 100
|
how_many = 100
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
for i in range(how_many):
|
for i in range(how_many):
|
||||||
for j in range(8):
|
for j in range(8):
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("Testing floating point arithmetics...")
|
child.expect_exact("Testing floating point arithmetics...")
|
||||||
child.expect_exact("[SUCCESS]")
|
child.expect_exact("[SUCCESS]")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
index = child.expect_exact([
|
index = child.expect_exact([
|
||||||
"ipv6: Received (src = fd01::1, dst = fd01::2, next header = 0, length = 42)",
|
"ipv6: Received (src = fd01::1, dst = fd01::2, next header = 0, length = 42)",
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(r"OK \(\d+ tests\)")
|
child.expect(r"OK \(\d+ tests\)")
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(r"OK \(\d+ tests\)")
|
child.expect(r"OK \(\d+ tests\)")
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
# 1st 6LoWPAN fragment
|
# 1st 6LoWPAN fragment
|
||||||
child.expect(r"OK \(\d+ tests\)")
|
child.expect(r"OK \(\d+ tests\)")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
# embUnit tests
|
# embUnit tests
|
||||||
child.expect(r"OK \(\d+ tests\)")
|
child.expect(r"OK \(\d+ tests\)")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
# 1st 6LoWPAN fragment
|
# 1st 6LoWPAN fragment
|
||||||
child.expect_exact("PKTDUMP: data received:")
|
child.expect_exact("PKTDUMP: data received:")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()")
|
child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_create__EINVAL_addr()")
|
child.expect_exact(u"Calling test_sock_ip_create__EINVAL_addr()")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"Calling test_sock_udp_create__EADDRINUSE()")
|
child.expect_exact(u"Calling test_sock_udp_create__EADDRINUSE()")
|
||||||
child.expect_exact(u"Calling test_sock_udp_create__EAFNOSUPPORT()")
|
child.expect_exact(u"Calling test_sock_udp_create__EAFNOSUPPORT()")
|
||||||
|
|||||||
@ -47,6 +47,7 @@ FUNS = {
|
|||||||
|
|
||||||
ABS_ERROR_LIMIT = 0.011
|
ABS_ERROR_LIMIT = 0.011
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
total = 0
|
total = 0
|
||||||
errors = 0
|
errors = 0
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import pexpect
|
|||||||
|
|
||||||
DEFAULT_TIMEOUT = 5
|
DEFAULT_TIMEOUT = 5
|
||||||
|
|
||||||
|
|
||||||
class Strategy(object):
|
class Strategy(object):
|
||||||
def __init__(self, func=None):
|
def __init__(self, func=None):
|
||||||
if func != None:
|
if func != None:
|
||||||
@ -28,11 +29,13 @@ class Strategy(object):
|
|||||||
def execute(self, *args, **kwargs):
|
def execute(self, *args, **kwargs):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
||||||
class ApplicationStrategy(Strategy):
|
class ApplicationStrategy(Strategy):
|
||||||
def __init__(self, app_dir=os.getcwd(), func=None):
|
def __init__(self, app_dir=os.getcwd(), func=None):
|
||||||
super(ApplicationStrategy, self).__init__(func)
|
super(ApplicationStrategy, self).__init__(func)
|
||||||
self.app_dir = app_dir
|
self.app_dir = app_dir
|
||||||
|
|
||||||
|
|
||||||
class BoardStrategy(Strategy):
|
class BoardStrategy(Strategy):
|
||||||
def __init__(self, board, func=None):
|
def __init__(self, board, func=None):
|
||||||
super(BoardStrategy, self).__init__(func)
|
super(BoardStrategy, self).__init__(func)
|
||||||
@ -50,22 +53,27 @@ class BoardStrategy(Strategy):
|
|||||||
def execute(self, application):
|
def execute(self, application):
|
||||||
super(BoardStrategy, self).execute(application)
|
super(BoardStrategy, self).execute(application)
|
||||||
|
|
||||||
|
|
||||||
class CleanStrategy(BoardStrategy):
|
class CleanStrategy(BoardStrategy):
|
||||||
def execute(self, application, env=None):
|
def execute(self, application, env=None):
|
||||||
super(CleanStrategy, self).__run_make(application, ("-B", "clean"), env)
|
super(CleanStrategy, self).__run_make(application, ("-B", "clean"), env)
|
||||||
|
|
||||||
|
|
||||||
class BuildStrategy(BoardStrategy):
|
class BuildStrategy(BoardStrategy):
|
||||||
def execute(self, application, env=None):
|
def execute(self, application, env=None):
|
||||||
super(BuildStrategy, self).__run_make(application, ("all",), env)
|
super(BuildStrategy, self).__run_make(application, ("all",), env)
|
||||||
|
|
||||||
|
|
||||||
class FlashStrategy(BoardStrategy):
|
class FlashStrategy(BoardStrategy):
|
||||||
def execute(self, application, env=None):
|
def execute(self, application, env=None):
|
||||||
super(FlashStrategy, self).__run_make(application, ("all",), env)
|
super(FlashStrategy, self).__run_make(application, ("all",), env)
|
||||||
|
|
||||||
|
|
||||||
class ResetStrategy(BoardStrategy):
|
class ResetStrategy(BoardStrategy):
|
||||||
def execute(self, application, env=None):
|
def execute(self, application, env=None):
|
||||||
super(ResetStrategy, self).__run_make(application, ("reset",), env)
|
super(ResetStrategy, self).__run_make(application, ("reset",), env)
|
||||||
|
|
||||||
|
|
||||||
class Board(object):
|
class Board(object):
|
||||||
def __init__(self, name, port=None, serial=None, clean=None,
|
def __init__(self, name, port=None, serial=None, clean=None,
|
||||||
build=None, flash=None,
|
build=None, flash=None,
|
||||||
@ -119,6 +127,7 @@ class Board(object):
|
|||||||
def reset(self, application=os.getcwd(), env=None):
|
def reset(self, application=os.getcwd(), env=None):
|
||||||
self.reset_strategy.execute(application, env)
|
self.reset_strategy.execute(application, env)
|
||||||
|
|
||||||
|
|
||||||
class BoardGroup(object):
|
class BoardGroup(object):
|
||||||
def __init__(self, boards):
|
def __init__(self, boards):
|
||||||
self.boards = boards
|
self.boards = boards
|
||||||
@ -148,6 +157,7 @@ class BoardGroup(object):
|
|||||||
for board in self.boards:
|
for board in self.boards:
|
||||||
board.reset(application, env)
|
board.reset(application, env)
|
||||||
|
|
||||||
|
|
||||||
def default_test_case(board_group, application, env=None):
|
def default_test_case(board_group, application, env=None):
|
||||||
for board in board_group:
|
for board in board_group:
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
@ -159,6 +169,7 @@ def default_test_case(board_group, application, env=None):
|
|||||||
logfile=sys.stdout) as spawn:
|
logfile=sys.stdout) as spawn:
|
||||||
spawn.expect("TEST: SUCCESS")
|
spawn.expect("TEST: SUCCESS")
|
||||||
|
|
||||||
|
|
||||||
class TestStrategy(ApplicationStrategy):
|
class TestStrategy(ApplicationStrategy):
|
||||||
def execute(self, board_groups, test_cases=[default_test_case],
|
def execute(self, board_groups, test_cases=[default_test_case],
|
||||||
timeout=DEFAULT_TIMEOUT, env=None):
|
timeout=DEFAULT_TIMEOUT, env=None):
|
||||||
@ -171,11 +182,13 @@ class TestStrategy(ApplicationStrategy):
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
||||||
def get_ipv6_address(spawn):
|
def get_ipv6_address(spawn):
|
||||||
spawn.sendline(u"ifconfig")
|
spawn.sendline(u"ifconfig")
|
||||||
spawn.expect(u"[A-Za-z0-9]{2}_[0-9]+: inet6 (fe80::[0-9a-f:]+)")
|
spawn.expect(u"[A-Za-z0-9]{2}_[0-9]+: inet6 (fe80::[0-9a-f:]+)")
|
||||||
return spawn.match.group(1)
|
return spawn.match.group(1)
|
||||||
|
|
||||||
|
|
||||||
def test_ipv6_send(board_group, application, env=None):
|
def test_ipv6_send(board_group, application, env=None):
|
||||||
env_sender = os.environ.copy()
|
env_sender = os.environ.copy()
|
||||||
if env != None:
|
if env != None:
|
||||||
@ -199,6 +212,7 @@ def test_ipv6_send(board_group, application, env=None):
|
|||||||
(receiver_ip, ipprot))
|
(receiver_ip, ipprot))
|
||||||
receiver.expect(u"00000000 01 23 45 67 89 AB CD EF")
|
receiver.expect(u"00000000 01 23 45 67 89 AB CD EF")
|
||||||
|
|
||||||
|
|
||||||
def test_udpv6_send(board_group, application, env=None):
|
def test_udpv6_send(board_group, application, env=None):
|
||||||
env_sender = os.environ.copy()
|
env_sender = os.environ.copy()
|
||||||
if env != None:
|
if env != None:
|
||||||
@ -223,6 +237,7 @@ def test_udpv6_send(board_group, application, env=None):
|
|||||||
(receiver_ip, port))
|
(receiver_ip, port))
|
||||||
receiver.expect(u"00000000 AB CD EF")
|
receiver.expect(u"00000000 AB CD EF")
|
||||||
|
|
||||||
|
|
||||||
def test_tcpv6_send(board_group, application, env=None):
|
def test_tcpv6_send(board_group, application, env=None):
|
||||||
env_client = os.environ.copy()
|
env_client = os.environ.copy()
|
||||||
if env != None:
|
if env != None:
|
||||||
@ -252,6 +267,7 @@ def test_tcpv6_send(board_group, application, env=None):
|
|||||||
client.sendline(u"tcp send affe:abe")
|
client.sendline(u"tcp send affe:abe")
|
||||||
client.expect_exact(u"could not send")
|
client.expect_exact(u"could not send")
|
||||||
|
|
||||||
|
|
||||||
def test_triple_send(board_group, application, env=None):
|
def test_triple_send(board_group, application, env=None):
|
||||||
env_sender = os.environ.copy()
|
env_sender = os.environ.copy()
|
||||||
if env != None:
|
if env != None:
|
||||||
|
|||||||
@ -12,12 +12,15 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def _ipv6_tests(code):
|
def _ipv6_tests(code):
|
||||||
return code & (1 << 6)
|
return code & (1 << 6)
|
||||||
|
|
||||||
|
|
||||||
def _ipv4_tests(code):
|
def _ipv4_tests(code):
|
||||||
return code & (1 << 4)
|
return code & (1 << 4)
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"code (0x[0-9a-f]{2})")
|
child.expect(u"code (0x[0-9a-f]{2})")
|
||||||
code = int(child.match.group(1), base=16)
|
code = int(child.match.group(1), base=16)
|
||||||
|
|||||||
@ -12,15 +12,19 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def _reuse_tests(code):
|
def _reuse_tests(code):
|
||||||
return code & 1
|
return code & 1
|
||||||
|
|
||||||
|
|
||||||
def _ipv6_tests(code):
|
def _ipv6_tests(code):
|
||||||
return code & (1 << 6)
|
return code & (1 << 6)
|
||||||
|
|
||||||
|
|
||||||
def _ipv4_tests(code):
|
def _ipv4_tests(code):
|
||||||
return code & (1 << 4)
|
return code & (1 << 4)
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"code (0x[0-9a-f]{2})")
|
child.expect(u"code (0x[0-9a-f]{2})")
|
||||||
code = int(child.match.group(1), base=16)
|
code = int(child.match.group(1), base=16)
|
||||||
|
|||||||
@ -12,15 +12,19 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def _reuse_tests(code):
|
def _reuse_tests(code):
|
||||||
return code & 1
|
return code & 1
|
||||||
|
|
||||||
|
|
||||||
def _ipv6_tests(code):
|
def _ipv6_tests(code):
|
||||||
return code & (1 << 6)
|
return code & (1 << 6)
|
||||||
|
|
||||||
|
|
||||||
def _ipv4_tests(code):
|
def _ipv4_tests(code):
|
||||||
return code & (1 << 4)
|
return code & (1 << 4)
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"code (0x[0-9a-f]{2})")
|
child.expect(u"code (0x[0-9a-f]{2})")
|
||||||
code = int(child.match.group(1), base=16)
|
code = int(child.match.group(1), base=16)
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"[SUCCESS]")
|
child.expect_exact(u"[SUCCESS]")
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"Test successful.")
|
child.expect(u"Test successful.")
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ thread_prio = {
|
|||||||
7: 1
|
7: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
for k in thread_prio.keys():
|
for k in thread_prio.keys():
|
||||||
child.expect(u"T%i \(prio %i\): trying to lock mutex now" % (k, thread_prio[k]))
|
child.expect(u"T%i \(prio %i\): trying to lock mutex now" % (k, thread_prio[k]))
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
|
child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
|
||||||
child.expect_exact("00000000 41 42 00")
|
child.expect_exact("00000000 41 42 00")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
|
child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)")
|
||||||
child.expect_exact("00000000 41 42 00 AB.")
|
child.expect_exact("00000000 41 42 00 AB.")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect('Decoding finished succesfully')
|
child.expect('Decoding finished succesfully')
|
||||||
|
|
||||||
|
|||||||
@ -12,8 +12,8 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
def testfunc(child):
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
child.expect(u".... . ._.. ._.. ___ / ._. .. ___ _ ___ ...", timeout=30)
|
child.expect(u".... . ._.. ._.. ___ / ._. .. ___ _ ___ ...", timeout=30)
|
||||||
child.expect(u"_ .... .. ... / .. ... / .._ __ ___ ._. ... .", timeout=30)
|
child.expect(u"_ .... .. ... / .. ... / .._ __ ___ ._. ... .", timeout=30)
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def test1(term):
|
def test1(term):
|
||||||
term.expect_exact("######################### TEST1:")
|
term.expect_exact("######################### TEST1:")
|
||||||
term.expect_exact("first: sem_init")
|
term.expect_exact("first: sem_init")
|
||||||
@ -34,6 +35,7 @@ def test1(term):
|
|||||||
term.expect_exact("first: sem_destroy")
|
term.expect_exact("first: sem_destroy")
|
||||||
term.expect_exact("first: end")
|
term.expect_exact("first: end")
|
||||||
|
|
||||||
|
|
||||||
def test2(term):
|
def test2(term):
|
||||||
term.expect_exact("######################### TEST2:")
|
term.expect_exact("######################### TEST2:")
|
||||||
term.expect_exact("first: sem_init")
|
term.expect_exact("first: sem_init")
|
||||||
@ -64,6 +66,7 @@ def test2(term):
|
|||||||
term.expect_exact("Thread 'priority 5' woke up.")
|
term.expect_exact("Thread 'priority 5' woke up.")
|
||||||
term.expect_exact("Back in main thread.")
|
term.expect_exact("Back in main thread.")
|
||||||
|
|
||||||
|
|
||||||
def test3(term):
|
def test3(term):
|
||||||
term.expect_exact("######################### TEST3:")
|
term.expect_exact("######################### TEST3:")
|
||||||
term.expect_exact("first: sem_init s1")
|
term.expect_exact("first: sem_init s1")
|
||||||
@ -80,6 +83,7 @@ def test3(term):
|
|||||||
term.expect_exact("post s1")
|
term.expect_exact("post s1")
|
||||||
term.expect_exact("Thread 2 woke up after waiting for s1.")
|
term.expect_exact("Thread 2 woke up after waiting for s1.")
|
||||||
|
|
||||||
|
|
||||||
def test4(term):
|
def test4(term):
|
||||||
term.expect_exact("######################### TEST4:")
|
term.expect_exact("######################### TEST4:")
|
||||||
term.expect_exact("first: sem_init s1")
|
term.expect_exact("first: sem_init s1")
|
||||||
@ -87,6 +91,7 @@ def test4(term):
|
|||||||
term.expect_exact("first: timed out")
|
term.expect_exact("first: timed out")
|
||||||
term.expect(r"first: waited 1\d{6} usec")
|
term.expect(r"first: waited 1\d{6} usec")
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
test1(child)
|
test1(child)
|
||||||
test2(child)
|
test2(child)
|
||||||
|
|||||||
@ -18,9 +18,11 @@ import testrunner
|
|||||||
US_PER_SEC = 1000000
|
US_PER_SEC = 1000000
|
||||||
EXTERNAL_JITTER = 0.15
|
EXTERNAL_JITTER = 0.15
|
||||||
|
|
||||||
|
|
||||||
class InvalidTimeout(Exception):
|
class InvalidTimeout(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
try:
|
try:
|
||||||
child.expect_exact("Please hit any key and then ENTER to continue")
|
child.expect_exact("Please hit any key and then ENTER to continue")
|
||||||
|
|||||||
@ -35,6 +35,7 @@ PS_EXPECTED = (
|
|||||||
('\t | SUM | | | \d+ (\d+)')
|
('\t | SUM | | | \d+ (\d+)')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _check_startup(child):
|
def _check_startup(child):
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
child.expect_exact('Creating thread #{}, next={}'
|
child.expect_exact('Creating thread #{}, next={}'
|
||||||
|
|||||||
@ -30,9 +30,11 @@ lock_depth = {
|
|||||||
7: 5
|
7: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def thread_prio_sort(x):
|
def thread_prio_sort(x):
|
||||||
return thread_prio.get(x)*1000 + x
|
return thread_prio.get(x)*1000 + x
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
for k in thread_prio.keys():
|
for k in thread_prio.keys():
|
||||||
child.expect(u"T%i \(prio %i, depth 0\): trying to lock rmutex now" %
|
child.expect(u"T%i \(prio %i, depth 0\): trying to lock rmutex now" %
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(r"MAIN: reply from T-\d+")
|
child.expect(r"MAIN: reply from T-\d+")
|
||||||
child.expect(r"MAIN: \d+! = \d+")
|
child.expect(r"MAIN: \d+! = \d+")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect('sender_thread start\r\n')
|
child.expect('sender_thread start\r\n')
|
||||||
child.expect('main thread alive\r\n')
|
child.expect('main thread alive\r\n')
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect('sender_thread start\r\n')
|
child.expect('sender_thread start\r\n')
|
||||||
child.expect('main thread alive\r\n')
|
child.expect('main thread alive\r\n')
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("[START]")
|
child.expect_exact("[START]")
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"OK \\([0-9]+ tests\\)")
|
child.expect(u"OK \\([0-9]+ tests\\)")
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("[START]")
|
child.expect_exact("[START]")
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect("[START]")
|
child.expect("[START]")
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("[START]")
|
child.expect_exact("[START]")
|
||||||
child.expect(u"\[RESULTS\] min=\d+, avg=\d+, max=\d+")
|
child.expect(u"\[RESULTS\] min=\d+, avg=\d+, max=\d+")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("xtimer_periodic_wakeup test application.")
|
child.expect_exact("xtimer_periodic_wakeup test application.")
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("xtimer_remove test application.")
|
child.expect_exact("xtimer_remove test application.")
|
||||||
child.expect_exact("Setting 3 timers, removing timer 0/3")
|
child.expect_exact("Setting 3 timers, removing timer 0/3")
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import sys
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("This test tests re-setting of an already active timer.")
|
child.expect_exact("This test tests re-setting of an already active timer.")
|
||||||
child.expect_exact("It should print three times \"now=<value>\", with "
|
child.expect_exact("It should print three times \"now=<value>\", with "
|
||||||
|
|||||||
@ -20,9 +20,11 @@ US_PER_SEC = 1000000
|
|||||||
INTERNAL_JITTER = 0.05
|
INTERNAL_JITTER = 0.05
|
||||||
EXTERNAL_JITTER = 0.15
|
EXTERNAL_JITTER = 0.15
|
||||||
|
|
||||||
|
|
||||||
class InvalidTimeout(Exception):
|
class InvalidTimeout(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect(u"Running test (\\d+) times with (\\d+) distinct sleep times")
|
child.expect(u"Running test (\\d+) times with (\\d+) distinct sleep times")
|
||||||
RUNS = int(child.match.group(1))
|
RUNS = int(child.match.group(1))
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import pexpect
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
def testfunc(child):
|
|
||||||
|
|
||||||
|
def testfunc(child):
|
||||||
child.expect(u"This test will call xtimer_usleep for values from \\d+ down to \\d+\r\n")
|
child.expect(u"This test will call xtimer_usleep for values from \\d+ down to \\d+\r\n")
|
||||||
|
|
||||||
i = 500
|
i = 500
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user