aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/22 object extraction/check-obj.py
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/common/22 object extraction/check-obj.py')
-rw-r--r--meson/test cases/common/22 object extraction/check-obj.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/meson/test cases/common/22 object extraction/check-obj.py b/meson/test cases/common/22 object extraction/check-obj.py
new file mode 100644
index 000000000..99c2cc546
--- /dev/null
+++ b/meson/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', 'r') as f:
+ cc = json.load(f)
+ output = set((x['output'] for x in cc))
+
+for obj in sys.argv[2:]:
+ if not os.path.exists(obj):
+ sys.exit(1)
+ if sys.argv[1] == 'ninja' and obj not in output:
+ sys.exit(1)
+ print('Verified', obj)