From 4c49c81008fc2f22c2eef2e019a11f80cd5464a8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 21 Aug 2024 11:00:48 +0200 Subject: Add test verifying lint information is propagated properly ... through all our various rules and forms of libraries. --- tests/test_cases/deps/lint/summary.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tests/test_cases/deps/lint/summary.py (limited to 'tests/test_cases/deps/lint/summary.py') 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) -- cgit v1.2.3