diff options
Diffstat (limited to 'test cases/failing/41 custom target outputs not matching install_dirs')
3 files changed, 62 insertions, 0 deletions
diff --git a/test cases/failing/41 custom target outputs not matching install_dirs/generator.py b/test cases/failing/41 custom target outputs not matching install_dirs/generator.py new file mode 100755 index 0000000..4ac6179 --- /dev/null +++ b/test cases/failing/41 custom target outputs not matching install_dirs/generator.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import sys, os + +if len(sys.argv) != 3: + print(sys.argv[0], '<namespace>', '<output dir>') + +name = sys.argv[1] +odir = sys.argv[2] + +with open(os.path.join(odir, name + '.h'), 'w') as f: + f.write('int func();\n') +with open(os.path.join(odir, name + '.c'), 'w') as f: + f.write('int main(int argc, char *argv[]) { return 0; }') +with open(os.path.join(odir, name + '.sh'), 'w') as f: + f.write('#!/bin/bash') diff --git a/test cases/failing/41 custom target outputs not matching install_dirs/meson.build b/test cases/failing/41 custom target outputs not matching install_dirs/meson.build new file mode 100644 index 0000000..ed99dba --- /dev/null +++ b/test cases/failing/41 custom target outputs not matching install_dirs/meson.build @@ -0,0 +1,13 @@ +project('outputs not matching install_dirs') + +gen = find_program('generator.py') + +if meson.backend() != 'ninja' + error('MESON_SKIP_TEST test is only for the ninja backend') +endif + +custom_target('too-few-install-dirs', + output : ['toofew.h', 'toofew.c', 'toofew.sh'], + command : [gen, 'toofew', '@OUTDIR@'], + install : true, + install_dir : [join_paths(get_option('prefix'), get_option('includedir')), false]) diff --git a/test cases/failing/41 custom target outputs not matching install_dirs/test.json b/test cases/failing/41 custom target outputs not matching install_dirs/test.json new file mode 100644 index 0000000..f9e2ba7 --- /dev/null +++ b/test cases/failing/41 custom target outputs not matching install_dirs/test.json @@ -0,0 +1,33 @@ +{ + "installed": [ + { + "type": "file", + "file": "usr/include/diff.h" + }, + { + "type": "file", + "file": "usr/include/first.h" + }, + { + "type": "file", + "file": "usr/bin/diff.sh" + }, + { + "type": "file", + "file": "usr/bin/second.sh" + }, + { + "type": "file", + "file": "opt/same.h" + }, + { + "type": "file", + "file": "opt/same.sh" + } + ], + "stdout": [ + { + "line": "ERROR: Target 'too-few-install-dirs' has 3 outputs: ['toofew.h', 'toofew.c', 'toofew.sh'], but only 2 \"install_dir\"s were found." + } + ] +} |