From d0201da89d078c119a3b29305118014aebc8b8ba Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 16 Mar 2025 08:56:25 +0100 Subject: [PATCH] gnu-json-result: add checks to the script --- util/gnu-json-result.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/gnu-json-result.py b/util/gnu-json-result.py index c1adb3ffc..c8c624b3f 100644 --- a/util/gnu-json-result.py +++ b/util/gnu-json-result.py @@ -9,7 +9,16 @@ from pathlib import Path out = {} +if len(sys.argv) != 2: + print("Usage: python gnu-json-result.py ") + sys.exit(1) + test_dir = Path(sys.argv[1]) +if not test_dir.is_dir(): + print(f"Directory {test_dir} does not exist.") + sys.exit(1) + +# Test all the logs from the test execution for filepath in test_dir.glob("**/*.log"): path = Path(filepath) current = out