aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNiklas Claesson <nicke.claesson@gmail.com>2017-09-18 18:09:41 +0200
committerNiklas Claesson <nicke.claesson@gmail.com>2017-09-20 13:00:34 +0200
commit07dde545d93b16c6bb4db443ffb7fbd75b3414de (patch)
tree23650aed7b009d07a81adac75e902a814c5bf74e /test cases
parentbbda3c7adb84dad775559c932a3cc9533ee6c145 (diff)
downloadmeson-07dde545d93b16c6bb4db443ffb7fbd75b3414de.zip
meson-07dde545d93b16c6bb4db443ffb7fbd75b3414de.tar.gz
meson-07dde545d93b16c6bb4db443ffb7fbd75b3414de.tar.bz2
Add @PLAINNAME@ and @BASENAME@ to arguments argument for Generator
Fixes #1282
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/98 gen extra/meson.build19
-rw-r--r--test cases/common/98 gen extra/name.l3
2 files changed, 22 insertions, 0 deletions
diff --git a/test cases/common/98 gen extra/meson.build b/test cases/common/98 gen extra/meson.build
index 52ed847..897ef41 100644
--- a/test cases/common/98 gen extra/meson.build
+++ b/test cases/common/98 gen extra/meson.build
@@ -11,3 +11,22 @@ g2 = gen.process('name.dat', extra_args: '--upper')
test('basic', executable('basic', 'plain.c', g1))
test('upper', executable('upper', 'upper.c', g2))
+
+cp = find_program('cp')
+basename_gen = generator(cp,
+ output : '@BASENAME@.c',
+ arguments : ['@INPUT@', join_paths('@BUILD_DIR@', '@BASENAME@.c')])
+
+# This test should produce a name.c
+basename_src = basename_gen.process('name.l')
+
+test('basename', executable('basename', basename_src))
+
+plainname_gen = generator(cp,
+ output : '@PLAINNAME@.c',
+ arguments : ['@INPUT@', join_paths('@BUILD_DIR@', '@PLAINNAME@.c')])
+
+# This test should produce a name.l.c
+plainname_src = plainname_gen.process('name.l')
+
+test('plainname', executable('plainname', plainname_src))
diff --git a/test cases/common/98 gen extra/name.l b/test cases/common/98 gen extra/name.l
new file mode 100644
index 0000000..3adda4f
--- /dev/null
+++ b/test cases/common/98 gen extra/name.l
@@ -0,0 +1,3 @@
+int main() {
+return 0;
+}