ci: fix Coverity false positives/negatives
The regular expression used to enumerate the files that have been
analysed by Coverity is fairly fallible, and sometimes catches more or
less than intended.
This change instead looks for an alternative line which is easier to
parse, which gives us the correct list of analysed files.
Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Iac6933ac45e9e1e3d01c6049e3c97c770367de55
diff --git a/script/tf-coverity/run_coverity_on_tf.py b/script/tf-coverity/run_coverity_on_tf.py
index daa9d03..3db17e7 100755
--- a/script/tf-coverity/run_coverity_on_tf.py
+++ b/script/tf-coverity/run_coverity_on_tf.py
@@ -81,9 +81,13 @@
with open(coverity_build_log, encoding="utf-8") as build_log:
for line in build_log:
line = re.sub('//','/', line)
- results = re.search("(?:COMPILING|EXECUTING):.*-c *(.*\.c).*-o.*\.o", line)
+ results = re.search(r"\[STATUS\] Compiling (.+\.c)", line)
if results is not None:
filename = results.group(1)
+
+ if os.path.isabs(filename):
+ filename = os.path.relpath(filename, tf_dir)
+
if filename not in analyzed:
analyzed.append(filename)