fix(coverity): build all configs before exiting

Bailing out immediately after a failure obscures other errors, which
inevitably appear on future coverity runs. Ensure all configurations are
built and report the last non-normal exit status. The script will fail as
before, but this ensures all errors in the tree are visible.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: Ifb293e986ac4d86be4bb41ec0ec4fb8ecb359943
diff --git a/script/tf-coverity/tf-cov-make b/script/tf-coverity/tf-cov-make
index 788ddc3..53e2b52 100755
--- a/script/tf-coverity/tf-cov-make
+++ b/script/tf-coverity/tf-cov-make
@@ -14,8 +14,8 @@
 # the project history.
 #
 
-# Bail out as soon as an error is encountered.
-set -e
+set -E
+trap 'rc=$?; error_count=$((error_count+1));' ERR INT
 
 TF_SOURCES=$1
 if [ ! -d "$TF_SOURCES" ]; then
@@ -754,4 +754,9 @@
 # Nuvoton npcm845x platform
 make PLAT=npcm845x $(common_flags) all SPD=opteed
 
+if [[ "$rc" -gt 0 ]]; then
+    echo "ERROR: tc-cov-make failed with $error_count failures"
+    exit $rc
+fi
+
 cd ..