summaryrefslogtreecommitdiff
path: root/meta-arm/meta-arm-systemready/recipes-test/arm-systemready-acs/arm-systemready-scripts/0001-check-sr-results-Return-non-zero-exit-code-on-failur.patch
blob: 6a95881d93fb1368750c65196328adbda61e7957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From ad8f2826f6e2cefb630f7fc2c7c99857f224e109 Mon Sep 17 00:00:00 2001
From: Debbie Martin <Debbie.Martin@arm.com>
Date: Tue, 5 Sep 2023 21:37:46 +0100
Subject: [PATCH] check-sr-results: Return non-zero exit code on failure

Return a non-zero exit code if there are any warnings or errors found.

Upstream-Status: Pending
Signed-off-by: Debbie Martin <Debbie.Martin@arm.com>
---
 check-sr-results.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/check-sr-results.py b/check-sr-results.py
index 12b89cd..48658f0 100755
--- a/check-sr-results.py
+++ b/check-sr-results.py
@@ -185,6 +185,9 @@ class Stats:
     def inc_error(self):
         self._inc('error')
 
+    def has_warnings_or_errors(self):
+        return self.data['warning'] or self.data['error']
+
 
 # Download (possibly large) file from URL.
 # We raise an exception in case of issue.
@@ -1519,3 +1522,6 @@ if __name__ == '__main__':
     if args.print_meta:
         print()
         print_meta()
+
+    if stats.has_warnings_or_errors():
+        exit(1)
-- 
2.25.1