Blob Blame History Raw
From 476e307fff0417ee546ef362fe1ae696417d680a Mon Sep 17 00:00:00 2001
From: Niklas Claesson <nicke.claesson@gmail.com>
Date: Mon, 30 Apr 2018 13:57:52 +0200
Subject: [PATCH 06/16] Add test to show issue

---
 .../161 index customtarget/check_args.py       | 18 ++++++++++++++++++
 .../common/161 index customtarget/meson.build  |  7 +++++++
 2 files changed, 25 insertions(+)
 create mode 100644 test cases/common/161 index customtarget/check_args.py

diff --git a/test cases/common/161 index customtarget/check_args.py b/test cases/common/161 index customtarget/check_args.py
new file mode 100644
index 00000000..8663a6fe
--- /dev/null
+++ b/test cases/common/161 index customtarget/check_args.py	
@@ -0,0 +1,18 @@
+#!python3
+
+import sys
+from pathlib import Path
+
+def main():
+    if len(sys.argv) != 2:
+        print(sys.argv)
+        return 1
+    if sys.argv[1] != 'gen.c':
+        print(sys.argv)
+        return 2
+    Path('foo').touch()
+
+    return 0
+
+if __name__ == '__main__':
+    sys.exit(main())
diff --git a/test cases/common/161 index customtarget/meson.build b/test cases/common/161 index customtarget/meson.build
index 11cb214b..27d28b56 100644
--- a/test cases/common/161 index customtarget/meson.build	
+++ b/test cases/common/161 index customtarget/meson.build	
@@ -29,4 +29,11 @@ lib = static_library(
   ['lib.c', gen[1]],
 )
 
+custom_target(
+  'foo',
+  input: gen[0],
+  output: 'foo',
+  command: [find_program('check_args.py'), '@INPUT@'],
+)
+
 subdir('subdir')
-- 
2.17.0