Skip to content

Commit

Permalink
tests/pkg_libsch: temporary add coverage instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 15, 2023
1 parent 1fa9646 commit f26066f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dist/pythonlibs/testrunner/spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def setup_child(timeout=10, spawnclass=pexpect.spawnu, env=None, logfile=None):

def teardown_child(child):
pid = child.pid
child.close()
time.sleep(1)
try:
os.killpg(os.getpgid(pid), signal.SIGTERM)
except ProcessLookupError:
Expand All @@ -111,7 +113,6 @@ def teardown_child(child):
except ProcessLookupError:
# This is what we actually wanted
pass
child.close()


def modules_list():
Expand Down
9 changes: 9 additions & 0 deletions tests/pkg_libschc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ DEBUG_TESTS ?= 0

$(call target-export-variables, test, DEBUG_TESTS)

CFLAGS += -fprofile-arcs -ftest-coverage
CFLAGS_OPT += -O0
LINKFLAGS += -fprofile-arcs -ftest-coverage

include $(RIOTBASE)/Makefile.include

COVERAGETESTDEPS ?= $(filter term test,$(MAKECMDGOALS))

coverage-report: $(COVERAGETESTDEPS)
gcovr -b -e "../../(boards|core|cpu|driver|sys)" --txt --html-details coverage/coverage.html -r ../../

0 comments on commit f26066f

Please sign in to comment.