summaryrefslogtreecommitdiffstats
path: root/test cases/failing/41 custom target outputs not matching install_dirs
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/failing/41 custom target outputs not matching install_dirs
parentInitial commit. (diff)
downloadmeson-upstream.tar.xz
meson-upstream.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/failing/41 custom target outputs not matching install_dirs')
-rwxr-xr-xtest cases/failing/41 custom target outputs not matching install_dirs/generator.py16
-rw-r--r--test cases/failing/41 custom target outputs not matching install_dirs/meson.build13
-rw-r--r--test cases/failing/41 custom target outputs not matching install_dirs/test.json33
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."
+ }
+ ]
+}