diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-04-24 23:41:24 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-06-02 04:50:32 +0000 |
commit | 862e1dd838fc2c81af9b77c6e20d5043172b9538 (patch) | |
tree | 3e2793b9621703f7076bd8d672e7c188967491a3 | |
parent | df2f6a71e7c32a477c141808d2dfdd49df8021fc (diff) | |
download | meson-862e1dd838fc2c81af9b77c6e20d5043172b9538.zip meson-862e1dd838fc2c81af9b77c6e20d5043172b9538.tar.gz meson-862e1dd838fc2c81af9b77c6e20d5043172b9538.tar.bz2 |
Add test case for 'install_mode'
This is a simple test case, checking for installed_files.txt, which just
makes sure the syntax is accepted.
Manual tests confirmed the permissions were set correctly.
A follow up commit adds a unit test based on this directory.
-rwxr-xr-x | run_project_tests.py | 2 | ||||
-rw-r--r-- | test cases/common/201 install_mode/config.h.in | 5 | ||||
-rw-r--r-- | test cases/common/201 install_mode/data_source.txt | 1 | ||||
-rw-r--r-- | test cases/common/201 install_mode/foo.1 | 1 | ||||
-rw-r--r-- | test cases/common/201 install_mode/installed_files.txt | 8 | ||||
-rw-r--r-- | test cases/common/201 install_mode/meson.build | 52 | ||||
-rw-r--r-- | test cases/common/201 install_mode/rootdir.h | 3 | ||||
-rw-r--r-- | test cases/common/201 install_mode/runscript.sh | 3 | ||||
-rw-r--r-- | test cases/common/201 install_mode/stat.c | 1 | ||||
-rw-r--r-- | test cases/common/201 install_mode/sub1/second.dat | 1 | ||||
-rw-r--r-- | test cases/common/201 install_mode/trivial.c | 6 |
11 files changed, 83 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 0b77a37..ad367b1 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -303,6 +303,8 @@ def pass_libdir_to_test(dirname): return False if '39 libdir' in dirname: return False + if '201 install_mode' in dirname: + return False return True def _run_test(testdir, test_build_dir, install_dir, extra_args, compiler, backend, flags, commands, should_fail): diff --git a/test cases/common/201 install_mode/config.h.in b/test cases/common/201 install_mode/config.h.in new file mode 100644 index 0000000..14a1558 --- /dev/null +++ b/test cases/common/201 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/201 install_mode/data_source.txt b/test cases/common/201 install_mode/data_source.txt new file mode 100644 index 0000000..0c23cc0 --- /dev/null +++ b/test cases/common/201 install_mode/data_source.txt @@ -0,0 +1 @@ +This is a text only input file. diff --git a/test cases/common/201 install_mode/foo.1 b/test cases/common/201 install_mode/foo.1 new file mode 100644 index 0000000..647c097 --- /dev/null +++ b/test cases/common/201 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/201 install_mode/installed_files.txt b/test cases/common/201 install_mode/installed_files.txt new file mode 100644 index 0000000..00fb231 --- /dev/null +++ b/test cases/common/201 install_mode/installed_files.txt @@ -0,0 +1,8 @@ +usr/bin/runscript.sh +usr/bin/trivialprog?exe +usr/include/config.h +usr/include/rootdir.h +usr/libtest/libstat.a +usr/share/man/man1/foo.1.gz +usr/share/sub1/second.dat +usr/subdir/data.dat diff --git a/test cases/common/201 install_mode/meson.build b/test cases/common/201 install_mode/meson.build new file mode 100644 index 0000000..d06371f --- /dev/null +++ b/test cases/common/201 install_mode/meson.build @@ -0,0 +1,52 @@ +project('install_mode test', 'c', + default_options : ['install_umask=027', 'libdir=libtest']) + +# 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']) + +# 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, + 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/201 install_mode/rootdir.h b/test cases/common/201 install_mode/rootdir.h new file mode 100644 index 0000000..72fb132 --- /dev/null +++ b/test cases/common/201 install_mode/rootdir.h @@ -0,0 +1,3 @@ +/* This header goes to include dir root. */ + +int root_func(); diff --git a/test cases/common/201 install_mode/runscript.sh b/test cases/common/201 install_mode/runscript.sh new file mode 100644 index 0000000..8bc5ca6 --- /dev/null +++ b/test cases/common/201 install_mode/runscript.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Runscript" diff --git a/test cases/common/201 install_mode/stat.c b/test cases/common/201 install_mode/stat.c new file mode 100644 index 0000000..fa76a65 --- /dev/null +++ b/test cases/common/201 install_mode/stat.c @@ -0,0 +1 @@ +int func() { return 933; } diff --git a/test cases/common/201 install_mode/sub1/second.dat b/test cases/common/201 install_mode/sub1/second.dat new file mode 100644 index 0000000..48857a8 --- /dev/null +++ b/test cases/common/201 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/201 install_mode/trivial.c b/test cases/common/201 install_mode/trivial.c new file mode 100644 index 0000000..24ac454 --- /dev/null +++ b/test cases/common/201 install_mode/trivial.c @@ -0,0 +1,6 @@ +#include<stdio.h> + +int main(int argc, char **argv) { + printf("Trivial test is working.\n"); + return 0; +} |