Skip to content

Commit

Permalink
tests: use run_check_unittests() where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Mar 4, 2021
1 parent 3cbd517 commit 583e5e3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
13 changes: 10 additions & 3 deletions tests/driver_ds1307/tests-with-config/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@
# directory for more details.

import sys
from testrunner import run

import pexpect

from testrunner import run, run_check_unittests


def testfunc(child):
child.expect([r"OK \([0-9]+ tests\)",
r"error: unable to initialize RTC \[I2C initialization error\]"])
res = child.expect([
r"error: unable to initialize RTC \[I2C initialization error\]",
pexpect.TIMEOUT,
])
if res == 1:
run_check_unittests()


if __name__ == "__main__":
Expand Down
8 changes: 2 additions & 6 deletions tests/gnrc_sixlowpan_frag_minfwd/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
8 changes: 2 additions & 6 deletions tests/gnrc_sixlowpan_frag_sfr/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
8 changes: 2 additions & 6 deletions tests/pkg_libbase58/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
# directory for more details.

import sys
from testrunner import run


def testfunc(child):
child.expect(u"OK \\([0-9]+ tests\\)")
from testrunner import run_check_unittests


if __name__ == "__main__":
sys.exit(run(testfunc, timeout=120))
sys.exit(run_check_unittests(timeout=120))
4 changes: 2 additions & 2 deletions tests/suit_manifest/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import os
import sys
from testrunner import run
from testrunner import run, run_check_unittests


def testfunc(child):
Expand All @@ -17,7 +17,7 @@ def testfunc(child):
# 16 seconds on `samr21-xpro`
# >50 seconds on `nrf51dk`
timeout = 60 if board != 'native' else -1
child.expect(r"OK \(\d+ tests\)", timeout=timeout)
run_check_unittests(timeout=timeout)


if __name__ == "__main__":
Expand Down

0 comments on commit 583e5e3

Please sign in to comment.