summaryrefslogtreecommitdiffstats
path: root/test cases/common/190 install_mode
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/common/190 install_mode
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/common/190 install_mode')
-rw-r--r--test cases/common/190 install_mode/config.h.in5
-rw-r--r--test cases/common/190 install_mode/data_source.txt1
-rw-r--r--test cases/common/190 install_mode/foo.11
-rw-r--r--test cases/common/190 install_mode/meson.build60
-rw-r--r--test cases/common/190 install_mode/rootdir.h3
-rw-r--r--test cases/common/190 install_mode/runscript.sh3
-rw-r--r--test cases/common/190 install_mode/stat.c1
-rw-r--r--test cases/common/190 install_mode/sub1/second.dat1
-rw-r--r--test cases/common/190 install_mode/sub2/stub0
-rw-r--r--test cases/common/190 install_mode/test.json22
-rw-r--r--test cases/common/190 install_mode/trivial.c6
11 files changed, 103 insertions, 0 deletions
diff --git a/test cases/common/190 install_mode/config.h.in b/test cases/common/190 install_mode/config.h.in
new file mode 100644
index 0000000..14a1558
--- /dev/null
+++ b/test cases/common/190 install_mode/config.h.in
@@ -0,0 +1,5 @@
+#define MESSAGE "@var@"
+#define OTHER "@other@" "@second@" "@empty@"
+
+#mesondefine BE_TRUE
+#mesondefine SHOULD_BE_UNDEF
diff --git a/test cases/common/190 install_mode/data_source.txt b/test cases/common/190 install_mode/data_source.txt
new file mode 100644
index 0000000..0c23cc0
--- /dev/null
+++ b/test cases/common/190 install_mode/data_source.txt
@@ -0,0 +1 @@
+This is a text only input file.
diff --git a/test cases/common/190 install_mode/foo.1 b/test cases/common/190 install_mode/foo.1
new file mode 100644
index 0000000..647c097
--- /dev/null
+++ b/test cases/common/190 install_mode/foo.1
@@ -0,0 +1 @@
+this is a man page of foo.1 its contents are irrelevant
diff --git a/test cases/common/190 install_mode/meson.build b/test cases/common/190 install_mode/meson.build
new file mode 100644
index 0000000..e877ba7
--- /dev/null
+++ b/test cases/common/190 install_mode/meson.build
@@ -0,0 +1,60 @@
+project('install_mode test', 'c',
+ default_options : ['install_umask=027', 'libdir=libtest'])
+
+if build_machine.system() == 'windows'
+ error('MESON_SKIP_TEST: install_mode test requires a Unix-like OS')
+endif
+
+# confirm no regressions in install_data
+install_data('runscript.sh',
+ install_dir : get_option('bindir'),
+ install_mode : ['rwxr-sr-x', 'root', 0])
+
+# confirm no regressions in install_subdir
+install_subdir('sub1',
+ install_dir : 'share',
+ install_mode : ['rwxr-x--t', 'root'])
+
+install_subdir('sub2',
+ install_dir : 'share')
+
+# test install_mode in configure_file
+conf = configuration_data()
+conf.set('var', 'mystring')
+conf.set('other', 'string 2')
+conf.set('second', ' bonus')
+conf.set('BE_TRUE', true)
+configure_file(input : 'config.h.in',
+ output : 'config.h',
+ configuration : conf,
+ install_dir : 'include',
+ install_mode : 'rw-rwSr--')
+
+# test install_mode in custom_target
+custom_target('bindat',
+ output : 'data.dat',
+ input : 'data_source.txt',
+ command : ['cp', '@INPUT@', '@OUTPUT@'],
+ install : true,
+ install_dir : 'subdir',
+ install_mode : 'rw-rwSr--')
+
+# test install_mode in install_headers
+install_headers('rootdir.h',
+ install_mode : 'r--r--r-T')
+
+# test install_mode in install_man
+install_man('foo.1',
+ install_mode : 'r--r--r-T')
+
+# test install_mode in executable
+executable('trivialprog',
+ sources : 'trivial.c',
+ install : true,
+ build_rpath: meson.current_build_dir(),
+ install_mode : ['rwxr-sr-x', 'root', 'root'])
+
+# test install_mode in static_library
+static_library('stat', 'stat.c',
+ install : true,
+ install_mode : ['rw---Sr--'])
diff --git a/test cases/common/190 install_mode/rootdir.h b/test cases/common/190 install_mode/rootdir.h
new file mode 100644
index 0000000..72fb132
--- /dev/null
+++ b/test cases/common/190 install_mode/rootdir.h
@@ -0,0 +1,3 @@
+/* This header goes to include dir root. */
+
+int root_func();
diff --git a/test cases/common/190 install_mode/runscript.sh b/test cases/common/190 install_mode/runscript.sh
new file mode 100644
index 0000000..8bc5ca6
--- /dev/null
+++ b/test cases/common/190 install_mode/runscript.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "Runscript"
diff --git a/test cases/common/190 install_mode/stat.c b/test cases/common/190 install_mode/stat.c
new file mode 100644
index 0000000..4825cef
--- /dev/null
+++ b/test cases/common/190 install_mode/stat.c
@@ -0,0 +1 @@
+int func(void) { return 933; }
diff --git a/test cases/common/190 install_mode/sub1/second.dat b/test cases/common/190 install_mode/sub1/second.dat
new file mode 100644
index 0000000..48857a8
--- /dev/null
+++ b/test cases/common/190 install_mode/sub1/second.dat
@@ -0,0 +1 @@
+Test that multiple install_subdirs meld their results. \ No newline at end of file
diff --git a/test cases/common/190 install_mode/sub2/stub b/test cases/common/190 install_mode/sub2/stub
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test cases/common/190 install_mode/sub2/stub
diff --git a/test cases/common/190 install_mode/test.json b/test cases/common/190 install_mode/test.json
new file mode 100644
index 0000000..a58caa1
--- /dev/null
+++ b/test cases/common/190 install_mode/test.json
@@ -0,0 +1,22 @@
+{
+ "installed": [
+ {"type": "file", "file": "usr/bin/runscript.sh"},
+ {"type": "exe", "file": "usr/bin/trivialprog"},
+ {"type": "pdb", "file": "usr/bin/trivialprog"},
+ {"type": "file", "file": "usr/include/config.h"},
+ {"type": "file", "file": "usr/include/rootdir.h"},
+ {"type": "file", "file": "usr/libtest/libstat.a"},
+ {"type": "file", "file": "usr/share/man/man1/foo.1"},
+ {"type": "file", "file": "usr/share/sub1/second.dat"},
+ {"type": "file", "file": "usr/share/sub2/stub"},
+ {"type": "file", "file": "usr/subdir/data.dat"}
+ ],
+ "do_not_set_opts": ["libdir"],
+ "stdout": [
+ {
+ "line": ".* DEPRECATION: install_mode with the sticky bit on a file",
+ "match": "re",
+ "count": 3
+ }
+ ]
+}
diff --git a/test cases/common/190 install_mode/trivial.c b/test cases/common/190 install_mode/trivial.c
new file mode 100644
index 0000000..96612d4
--- /dev/null
+++ b/test cases/common/190 install_mode/trivial.c
@@ -0,0 +1,6 @@
+#include<stdio.h>
+
+int main(void) {
+ printf("Trivial test is working.\n");
+ return 0;
+}