summaryrefslogtreecommitdiffstats
path: root/test cases/frameworks/8 flex/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/frameworks/8 flex/meson.build
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/frameworks/8 flex/meson.build')
-rw-r--r--test cases/frameworks/8 flex/meson.build36
1 files changed, 36 insertions, 0 deletions
diff --git a/test cases/frameworks/8 flex/meson.build b/test cases/frameworks/8 flex/meson.build
new file mode 100644
index 0000000..55b96dd
--- /dev/null
+++ b/test cases/frameworks/8 flex/meson.build
@@ -0,0 +1,36 @@
+project('flex and bison', 'c')
+
+# The point of this test is that one generator
+# may output headers that are necessary to build
+# the sources of a different generator.
+
+flex = find_program('flex', required: false)
+bison = find_program('bison', required: false)
+
+if not flex.found()
+ error('MESON_SKIP_TEST flex not found.')
+endif
+
+if not bison.found()
+ error('MESON_SKIP_TEST bison not found.')
+endif
+
+lgen = generator(flex,
+output : '@PLAINNAME@.yy.c',
+arguments : ['-o', '@OUTPUT@', '@INPUT@'])
+
+lfiles = lgen.process('lexer.l')
+
+pgen = generator(bison,
+output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
+arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
+
+pfiles = pgen.process('parser.y')
+
+e = executable('pgen', 'prog.c',
+ lfiles,
+ pfiles,
+ override_options: 'unity=off')
+
+test('parsertest', e,
+ args: [meson.current_source_dir() / 'testfile'])