Prevent tests passing with old code coverage data.
If code coverage data is more than a month older than the most recent commit,
make test.py fail and request regeneration of test data.
diff --git a/tools/test.py b/tools/test.py
index 9a081d0..75c700d 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -168,6 +168,8 @@
help='Do not run clang-tidy.')
general_arguments.add_argument('--notest', action='store_true',
help='Do not run tests.')
+ general_arguments.add_argument('--nocheck-code-coverage', action='store_true',
+ help='Do not check code coverage results log.')
general_arguments.add_argument('--fail-early', action='store_true',
help='Exit as soon as a test fails.')
general_arguments.add_argument(
@@ -273,6 +275,10 @@
jobs = jobs,
progress_prefix = 'clang-tidy: ')
+def CheckCodeCoverage():
+ command = ['tools/check_recent_coverage.sh']
+ return RunCommand(command)
+
def BuildAll(build_options, jobs, environment_options):
scons_command = ['scons', '-C', dir_root, 'all', '-j', str(jobs)]
if util.IsCommandAvailable('ccache'):
@@ -359,6 +365,9 @@
if args.under_valgrind:
util.require_program('valgrind')
+ if not args.nocheck_code_coverage:
+ rc.Combine(CheckCodeCoverage())
+
tests = test_runner.TestQueue()
if not args.nolint and not args.dry_run:
rc.Combine(RunLinter(args.jobs))