Coverity: copy coverity code from tf-a-ci-scripts
This is a complete copy of the two folders [1,2], based on working dir
from commit [3]. Several pieces DO NOT fit in TF-M, i.e. exclude
paths, toolchain, coverity 'build cmd', etc. but we introduce the code as
'it is' from TF-A project for completeness, then following commits would do
proper changes based on this code.
The Coverity Scan is an static analysis tool that works at 'tree
level' and it scans compiled code.
This is part of the tasks intended for milestone 2 (M2) defined at [4].
[1]
https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git/tree/script/tf-coverity
[2]
https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git/tree/coverity
[3]
https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git/commit/?id=97e2ef03aa6aa3ca9cb40e63a14765bda2c105c6
[4] https://developer.trustedfirmware.org/w/collaboration/openci/
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: I90ce8f1e9fcecc54cf80c759073e57f10e339c9c
diff --git a/script/tf-coverity/utils.py b/script/tf-coverity/utils.py
new file mode 100644
index 0000000..f86667f
--- /dev/null
+++ b/script/tf-coverity/utils.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+import subprocess
+
+def exec_prog(prog, args=[], out=None, out_text_mode=False):
+ # Build the command line to execute
+ cmd = [ prog ] + args
+
+ # Spawn process.
+ # Note: The standard error output is captured into the same file handle as
+ # for stdout.
+ process = subprocess.Popen(cmd, stdout=out, stderr=subprocess.STDOUT,
+ universal_newlines=out_text_mode, bufsize=0)
+ print("Spawned process with PID %u" % process.pid)
+ return process