CI: also generate coverage for unit tests
sanitycheck: Compile unit tests with coverage enabled always
+ run also first unit tests together with native_posix
shippable: also include unit_testing coverage into report to
codecov
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
diff --git a/scripts/sanitycheck b/scripts/sanitycheck
index 5666870..756cb7e 100755
--- a/scripts/sanitycheck
+++ b/scripts/sanitycheck
@@ -950,8 +950,8 @@
build_logfile = os.path.join(outdir, "build.log")
run_logfile = os.path.join(outdir, "run.log")
handler_logfile = os.path.join(outdir, "handler.log")
- if coverage:
- args += ["COVERAGE=1"]
+
+ args += ["COVERAGE=1", "EXTRA_LDFLAGS=--coverage"]
# we handle running in the UnitHandler class
text = (self._get_rule_header(name) +
@@ -2393,15 +2393,15 @@
reason))
- def native_posix_first(a, b):
- if a[0].startswith('native_posix'):
+ def native_posix_and_unit_first(a, b):
+ if a[0].startswith('native_posix') or a[0].startswith('unit_testing'):
return -1
- if b[0].startswith('native_posix'):
+ if b[0].startswith('native_posix') or b[0].startswith('unit_testing'):
return 1
return (a > b) - (a < b)
ts.instances = OrderedDict(sorted(ts.instances.items(),
- key=cmp_to_key(native_posix_first)))
+ key=cmp_to_key(native_posix_and_unit_first)))
if options.save_tests:
ts.run_report(options.save_tests)