aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/166 custom target template substitution
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-08-18 23:58:49 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-08-19 12:39:46 +0300
commit972535a6ac9fb1f9611c1b68293f7df88ec1b1f7 (patch)
treeed17817547da3e20c5c3080075c8924c24f6b3f9 /test cases/common/166 custom target template substitution
parentedf901431272e5bb348e265113179c337f65a881 (diff)
downloadmeson-972535a6ac9fb1f9611c1b68293f7df88ec1b1f7.zip
meson-972535a6ac9fb1f9611c1b68293f7df88ec1b1f7.tar.gz
meson-972535a6ac9fb1f9611c1b68293f7df88ec1b1f7.tar.bz2
Condense test dirs.
Diffstat (limited to 'test cases/common/166 custom target template substitution')
-rw-r--r--test cases/common/166 custom target template substitution/checkcopy.py9
-rw-r--r--test cases/common/166 custom target template substitution/foo.c.in6
-rw-r--r--test cases/common/166 custom target template substitution/meson.build17
3 files changed, 32 insertions, 0 deletions
diff --git a/test cases/common/166 custom target template substitution/checkcopy.py b/test cases/common/166 custom target template substitution/checkcopy.py
new file mode 100644
index 0000000..ab9f436
--- /dev/null
+++ b/test cases/common/166 custom target template substitution/checkcopy.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import sys
+import shutil
+
+if '@INPUT1@' in sys.argv[1]:
+ shutil.copyfile(sys.argv[2], sys.argv[3])
+else:
+ sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1]))
diff --git a/test cases/common/166 custom target template substitution/foo.c.in b/test cases/common/166 custom target template substitution/foo.c.in
new file mode 100644
index 0000000..d53846f
--- /dev/null
+++ b/test cases/common/166 custom target template substitution/foo.c.in
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main() {
+ printf("foo is working.\n");
+ return 0;
+}
diff --git a/test cases/common/166 custom target template substitution/meson.build b/test cases/common/166 custom target template substitution/meson.build
new file mode 100644
index 0000000..737408e
--- /dev/null
+++ b/test cases/common/166 custom target template substitution/meson.build
@@ -0,0 +1,17 @@
+project('custom target template substitution', 'c')
+
+check = find_program('checkcopy.py')
+
+config = configuration_data()
+
+config_file = configure_file(configuration : config, output : 'x@IN')
+
+# Check that substitution does not find @FOO@ and then misses @INPUT0@.
+# Check the resulting x@INPUT1@ is not replaced.
+foo = custom_target('runcheck',
+ input : [config_file, 'foo.c.in'],
+ output : 'foo.c',
+ command : [check, '-D@FOO@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@']
+)
+
+executable('foo', foo)