From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- test cases/common/22 object extraction/check-obj.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test cases/common/22 object extraction/check-obj.py (limited to 'test cases/common/22 object extraction/check-obj.py') diff --git a/test cases/common/22 object extraction/check-obj.py b/test cases/common/22 object extraction/check-obj.py new file mode 100644 index 0000000..d6afbcc --- /dev/null +++ b/test cases/common/22 object extraction/check-obj.py @@ -0,0 +1,21 @@ +#! /usr/bin/env python3 + +import json +import sys +import os + +cc = None +output = None + +# Only the ninja backend produces compile_commands.json +if sys.argv[1] == 'ninja': + with open('compile_commands.json') as f: + cc = json.load(f) + output = {x['output'] for x in cc} + +for obj in sys.argv[2:]: + if not os.path.exists(obj): + sys.exit(f'File {obj} not found.') + if sys.argv[1] == 'ninja' and obj not in output: + sys.exit(1) + print('Verified', obj) -- cgit v1.2.3