Commit b1290cb8 authored by Jordan Yates's avatar Jordan Yates Committed by Johan Hedberg
Browse files

scripts: twisterlib: filter coverage information



When dumping logs from the `--inline-logs` option, remove any coverage
information that may be contained in those logs. Coverage dumps are
unrelated to any test failures and make it harder to find the failing
test information. In extreme cases the relevant information is lost due
to terminal scrollback limits.

If the raw dump information is required, it is still present in the
original `handler.log` file.

Signed-off-by: default avatarJordan Yates <jordan@embeint.com>
parent be71be5d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -553,6 +553,13 @@ class ProjectBuilder(FilterBuilder):
            except Exception as e:
                data = "Unable to read log data (%s)\n" % (str(e))

            # Remove any coverage data from the dumped logs
            data = re.sub(
                r"GCOV_COVERAGE_DUMP_START.*GCOV_COVERAGE_DUMP_END",
                "GCOV_COVERAGE_DUMP_START\n...\nGCOV_COVERAGE_DUMP_END",
                data,
                flags=re.DOTALL,
            )
            logger.error(data)

            logger.info("{:-^100}".format(filename))