summaryrefslogtreecommitdiff
path: root/tests/test_cases/deps/lint/summary.py
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-21 11:00:48 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-23 15:33:21 +0200
commit4c49c81008fc2f22c2eef2e019a11f80cd5464a8 (patch)
tree09da6796020008e9233716da1a283b30e4ca7ef2 /tests/test_cases/deps/lint/summary.py
parentd62cbb609f486becb6603e1712d81ba52788232e (diff)
downloadrules-cc-4c49c81008fc2f22c2eef2e019a11f80cd5464a8.tar.gz
Add test verifying lint information is propagated properly
... through all our various rules and forms of libraries.
Diffstat (limited to 'tests/test_cases/deps/lint/summary.py')
-rwxr-xr-xtests/test_cases/deps/lint/summary.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_cases/deps/lint/summary.py b/tests/test_cases/deps/lint/summary.py
new file mode 100755
index 0000000..361f681
--- /dev/null
+++ b/tests/test_cases/deps/lint/summary.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+import json
+import os
+import sys
+
+status = 0
+invocations = {}
+
+for lint in sorted(os.listdir()):
+ if os.path.isdir(lint):
+ with open(os.path.join(lint, "result")) as f:
+ result = f.read().strip()
+ if result != "PASS":
+ status = 1
+ with open(os.path.join(lint, "stdout")) as f:
+ print(f.read())
+ with open(os.path.join(lint, "stderr")) as f:
+ print(f.read())
+ with open(os.path.join(lint, "out/invocation.json")) as f:
+ invocation = json.load(f)
+ invocations[invocation[0]] = invocation[1:]
+
+with open(os.path.join(os.environ["OUT"], "invocations.json"), "w") as f:
+ json.dump(invocations, f)
+
+sys.exit(status)