diff options
| author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-01-23 15:23:13 +0000 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-09-10 07:20:41 +0000 |
| commit | 88e13c5f7c8e977ed879cabaa2800c211a536b60 (patch) | |
| tree | 3e168d5b347d8925cc78885de845febc2cc92fa4 /test cases | |
| parent | 79b2eeb1baae4097335997c191e1eb9626f27ce5 (diff) | |
| download | meson-88e13c5f7c8e977ed879cabaa2800c211a536b60.tar.gz | |
Split tests out from 'common' which require a native compiler
Split out tests (and parts of tests) which require a native compiler
from the 'common' suite to a new suite called 'native', so we can
selectively avoid running those tests when only a cross-compiler is
available.
Also move test '211 cmake module' to 'cmake' suite, since it appears
that the way we use cmake requires a native compiler.
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/cmake/211 cmake module/cmake_project/CMakeLists.txt (renamed from test cases/common/211 cmake module/cmake_project/CMakeLists.txt) | 0 | ||||
| -rw-r--r-- | test cases/cmake/211 cmake module/meson.build (renamed from test cases/common/211 cmake module/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/cmake/211 cmake module/projectConfig.cmake.in (renamed from test cases/common/211 cmake module/projectConfig.cmake.in) | 0 | ||||
| -rw-r--r-- | test cases/cmake/211 cmake module/test.json (renamed from test cases/common/211 cmake module/test.json) | 0 | ||||
| -rw-r--r-- | test cases/common/1 trivial/meson.build | 5 | ||||
| -rw-r--r-- | test cases/common/21 global arg/meson.build | 17 | ||||
| -rw-r--r-- | test cases/common/56 install script/meson.build | 6 | ||||
| -rw-r--r-- | test cases/common/56 install script/src/meson.build | 2 | ||||
| -rw-r--r-- | test cases/common/56 install script/test.json | 5 | ||||
| -rw-r--r-- | test cases/common/85 add language/meson.build | 3 | ||||
| -rw-r--r-- | test cases/native/1 trivial/meson.build | 9 | ||||
| -rw-r--r-- | test cases/native/1 trivial/trivial.c | 6 | ||||
| -rw-r--r-- | test cases/native/162 external program shebang parsing/input.txt (renamed from test cases/common/162 external program shebang parsing/input.txt) | 0 | ||||
| -rw-r--r-- | test cases/native/162 external program shebang parsing/main.c (renamed from test cases/common/162 external program shebang parsing/main.c) | 0 | ||||
| -rw-r--r-- | test cases/native/162 external program shebang parsing/meson.build (renamed from test cases/common/162 external program shebang parsing/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/162 external program shebang parsing/script.int.in (renamed from test cases/common/162 external program shebang parsing/script.int.in) | 0 | ||||
| -rw-r--r-- | test cases/native/201 override with exe/main2.input (renamed from test cases/common/201 override with exe/main2.input) | 0 | ||||
| -rw-r--r-- | test cases/native/201 override with exe/meson.build (renamed from test cases/common/201 override with exe/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/201 override with exe/subprojects/sub/foobar.c (renamed from test cases/common/201 override with exe/subprojects/sub/foobar.c) | 0 | ||||
| -rw-r--r-- | test cases/native/201 override with exe/subprojects/sub/meson.build (renamed from test cases/common/201 override with exe/subprojects/sub/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/21 global arg/meson.build | 14 | ||||
| -rw-r--r-- | test cases/native/21 global arg/prog.c | 43 | ||||
| -rw-r--r-- | test cases/native/21 global arg/prog.cc | 15 | ||||
| -rwxr-xr-x | test cases/native/27 pipeline/depends/copyrunner.py (renamed from test cases/common/27 pipeline/depends/copyrunner.py) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/depends/filecopier.c (renamed from test cases/common/27 pipeline/depends/filecopier.c) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/depends/libsrc.c.in (renamed from test cases/common/27 pipeline/depends/libsrc.c.in) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/depends/meson.build (renamed from test cases/common/27 pipeline/depends/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/depends/prog.c (renamed from test cases/common/27 pipeline/depends/prog.c) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/input_src.dat (renamed from test cases/common/27 pipeline/input_src.dat) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/meson.build (renamed from test cases/common/27 pipeline/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/prog.c (renamed from test cases/common/27 pipeline/prog.c) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/src/input_src.dat (renamed from test cases/common/27 pipeline/src/input_src.dat) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/src/meson.build (renamed from test cases/common/27 pipeline/src/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/src/prog.c (renamed from test cases/common/27 pipeline/src/prog.c) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/src/srcgen.c (renamed from test cases/common/27 pipeline/src/srcgen.c) | 0 | ||||
| -rw-r--r-- | test cases/native/27 pipeline/srcgen.c (renamed from test cases/common/27 pipeline/srcgen.c) | 0 | ||||
| -rw-r--r-- | test cases/native/36 tryrun/error.c (renamed from test cases/common/36 tryrun/error.c) | 0 | ||||
| -rw-r--r-- | test cases/native/36 tryrun/meson.build (renamed from test cases/common/36 tryrun/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/36 tryrun/no_compile.c (renamed from test cases/common/36 tryrun/no_compile.c) | 0 | ||||
| -rw-r--r-- | test cases/native/36 tryrun/ok.c (renamed from test cases/common/36 tryrun/ok.c) | 0 | ||||
| -rw-r--r-- | test cases/native/56 install script/file.txt | 0 | ||||
| -rw-r--r-- | test cases/native/56 install script/meson.build | 12 | ||||
| -rw-r--r-- | test cases/native/56 install script/src/exe.c (renamed from test cases/common/56 install script/src/exe.c) | 3 | ||||
| -rw-r--r-- | test cases/native/56 install script/src/meson.build | 1 | ||||
| -rw-r--r-- | test cases/native/56 install script/test.json | 8 | ||||
| -rwxr-xr-x | test cases/native/56 install script/wrap.py (renamed from test cases/common/56 install script/wrap.py) | 0 | ||||
| -rw-r--r-- | test cases/native/85 add language/meson.build | 3 | ||||
| -rw-r--r-- | test cases/native/85 add language/prog.cc | 6 | ||||
| -rw-r--r-- | test cases/native/93 selfbuilt custom/checkarg.cpp (renamed from test cases/common/93 selfbuilt custom/checkarg.cpp) | 0 | ||||
| -rw-r--r-- | test cases/native/93 selfbuilt custom/data.dat (renamed from test cases/common/93 selfbuilt custom/data.dat) | 0 | ||||
| -rw-r--r-- | test cases/native/93 selfbuilt custom/mainprog.cpp (renamed from test cases/common/93 selfbuilt custom/mainprog.cpp) | 0 | ||||
| -rw-r--r-- | test cases/native/93 selfbuilt custom/meson.build (renamed from test cases/common/93 selfbuilt custom/meson.build) | 0 | ||||
| -rw-r--r-- | test cases/native/93 selfbuilt custom/tool.cpp (renamed from test cases/common/93 selfbuilt custom/tool.cpp) | 0 |
53 files changed, 127 insertions, 31 deletions
diff --git a/test cases/common/211 cmake module/cmake_project/CMakeLists.txt b/test cases/cmake/211 cmake module/cmake_project/CMakeLists.txt index cd915846a..cd915846a 100644 --- a/test cases/common/211 cmake module/cmake_project/CMakeLists.txt +++ b/test cases/cmake/211 cmake module/cmake_project/CMakeLists.txt diff --git a/test cases/common/211 cmake module/meson.build b/test cases/cmake/211 cmake module/meson.build index 68f9993a6..68f9993a6 100644 --- a/test cases/common/211 cmake module/meson.build +++ b/test cases/cmake/211 cmake module/meson.build diff --git a/test cases/common/211 cmake module/projectConfig.cmake.in b/test cases/cmake/211 cmake module/projectConfig.cmake.in index fa3dfca0f..fa3dfca0f 100644 --- a/test cases/common/211 cmake module/projectConfig.cmake.in +++ b/test cases/cmake/211 cmake module/projectConfig.cmake.in diff --git a/test cases/common/211 cmake module/test.json b/test cases/cmake/211 cmake module/test.json index 2a5625a64..2a5625a64 100644 --- a/test cases/common/211 cmake module/test.json +++ b/test cases/cmake/211 cmake module/test.json diff --git a/test cases/common/1 trivial/meson.build b/test cases/common/1 trivial/meson.build index fb1142cb9..2e424d507 100644 --- a/test cases/common/1 trivial/meson.build +++ b/test cases/common/1 trivial/meson.build @@ -14,11 +14,6 @@ elif cc.get_id() == 'intel-cl' add_project_arguments('/Qdiag-error:10159', language : 'c') endif -if meson.is_cross_build() - native_exe = executable('native-trivialprog', sources : sources, native : true) - test('native exe in cross build', native_exe) -endif - exe = executable('trivialprog', sources : sources) assert(exe.name() == 'trivialprog') test('runtest', exe) # This is a comment diff --git a/test cases/common/21 global arg/meson.build b/test cases/common/21 global arg/meson.build index 5add17ec4..2a1c73669 100644 --- a/test cases/common/21 global arg/meson.build +++ b/test cases/common/21 global arg/meson.build @@ -1,23 +1,16 @@ project('global arg test', 'cpp', 'c') -add_global_arguments('-DMYTHING', language : 'c', native : true) -add_global_arguments('-DMYTHING', language : 'c', native : false) -add_global_arguments('-DMYCPPTHING', language : 'cpp', native : true) -add_global_arguments('-DMYCPPTHING', language : 'cpp', native : false) - -add_global_arguments('-DGLOBAL_BUILD', language : 'c', native : true) -add_global_arguments('-DGLOBAL_HOST', language : 'c', native : false) +add_global_arguments('-DMYTHING', language : 'c') +add_global_arguments('-DMYCPPTHING', language : 'cpp') +add_global_arguments('-DGLOBAL_HOST', language : 'c') build_c_args = ['-DARG_BUILD'] c_args = ['-DARG_HOST'] -add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp'], native: true) -add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp'], native: false) +add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp']) -exe1 = executable('prog1', 'prog.c', c_args : build_c_args, native : true) -exe2 = executable('prog2', 'prog.c', c_args : c_args, native : false) +exe2 = executable('prog2', 'prog.c', c_args : c_args) exe3 = executable('prog3', 'prog.cc') -test('prog1', exe1) test('prog2', exe2) test('prog3', exe3) diff --git a/test cases/common/56 install script/meson.build b/test cases/common/56 install script/meson.build index e80e66673..696e3f632 100644 --- a/test cases/common/56 install script/meson.build +++ b/test cases/common/56 install script/meson.build @@ -25,9 +25,3 @@ t = custom_target( meson.add_install_script('myinstall.py', 'customtarget', t, '--mode=copy') meson.add_install_script('myinstall.py', 'customtargetindex', t[0], '--mode=copy') - -meson.add_install_script(exe, 'generated.txt') -wrap = find_program('wrap.py') -# Yes, these are getting silly -meson.add_install_script(wrap, exe, 'wrapped.txt') -meson.add_install_script(wrap, wrap, exe, 'wrapped2.txt') diff --git a/test cases/common/56 install script/src/meson.build b/test cases/common/56 install script/src/meson.build index 1db424fa6..123fe1862 100644 --- a/test cases/common/56 install script/src/meson.build +++ b/test cases/common/56 install script/src/meson.build @@ -1,5 +1,3 @@ meson.add_install_script('myinstall.py', 'this/does', 'something-different.dat') afile = files('a file.txt') - -exe = executable('exe', 'exe.c', install : false, native : true) diff --git a/test cases/common/56 install script/test.json b/test cases/common/56 install script/test.json index b2a597138..3804fe148 100644 --- a/test cases/common/56 install script/test.json +++ b/test cases/common/56 install script/test.json @@ -9,9 +9,6 @@ {"type": "file", "file": "usr/dir/conf.txt"}, {"type": "file", "file": "usr/customtarget/1.txt"}, {"type": "file", "file": "usr/customtarget/2.txt"}, - {"type": "file", "file": "usr/customtargetindex/1.txt"}, - {"type": "file", "file": "usr/generated.txt"}, - {"type": "file", "file": "usr/wrapped.txt"}, - {"type": "file", "file": "usr/wrapped2.txt"} + {"type": "file", "file": "usr/customtargetindex/1.txt"} ] } diff --git a/test cases/common/85 add language/meson.build b/test cases/common/85 add language/meson.build index aa4972abd..e99f33a81 100644 --- a/test cases/common/85 add language/meson.build +++ b/test cases/common/85 add language/meson.build @@ -2,10 +2,9 @@ project('add language', 'c') test('C', executable('cprog', 'prog.c')) -assert(add_languages('cpp'), 'Add_languages returned false on success') +assert(add_languages('cpp', native: false), 'Add_languages returned false on success') assert(not add_languages('klingon', required : false), 'Add_languages returned true on failure.') test('C++', executable('cppprog', 'prog.cc')) -add_languages('c', native: true) add_languages('c', native: false) diff --git a/test cases/native/1 trivial/meson.build b/test cases/native/1 trivial/meson.build new file mode 100644 index 000000000..f6c5d4d68 --- /dev/null +++ b/test cases/native/1 trivial/meson.build @@ -0,0 +1,9 @@ +project('trivial native test', 'c') + +sources = 'trivial.c' +cc = meson.get_compiler('c', native: true) + +if meson.is_cross_build() + native_exe = executable('native-trivialprog', sources : sources, native : true) + test('native exe in cross build', native_exe) +endif diff --git a/test cases/native/1 trivial/trivial.c b/test cases/native/1 trivial/trivial.c new file mode 100644 index 000000000..96612d48b --- /dev/null +++ b/test cases/native/1 trivial/trivial.c @@ -0,0 +1,6 @@ +#include<stdio.h> + +int main(void) { + printf("Trivial test is working.\n"); + return 0; +} diff --git a/test cases/common/162 external program shebang parsing/input.txt b/test cases/native/162 external program shebang parsing/input.txt index 40e30d4b2..40e30d4b2 100644 --- a/test cases/common/162 external program shebang parsing/input.txt +++ b/test cases/native/162 external program shebang parsing/input.txt diff --git a/test cases/common/162 external program shebang parsing/main.c b/test cases/native/162 external program shebang parsing/main.c index 48b080e1f..48b080e1f 100644 --- a/test cases/common/162 external program shebang parsing/main.c +++ b/test cases/native/162 external program shebang parsing/main.c diff --git a/test cases/common/162 external program shebang parsing/meson.build b/test cases/native/162 external program shebang parsing/meson.build index c1cc5af9d..c1cc5af9d 100644 --- a/test cases/common/162 external program shebang parsing/meson.build +++ b/test cases/native/162 external program shebang parsing/meson.build diff --git a/test cases/common/162 external program shebang parsing/script.int.in b/test cases/native/162 external program shebang parsing/script.int.in index 77ff90907..77ff90907 100644 --- a/test cases/common/162 external program shebang parsing/script.int.in +++ b/test cases/native/162 external program shebang parsing/script.int.in diff --git a/test cases/common/201 override with exe/main2.input b/test cases/native/201 override with exe/main2.input index e69de29bb..e69de29bb 100644 --- a/test cases/common/201 override with exe/main2.input +++ b/test cases/native/201 override with exe/main2.input diff --git a/test cases/common/201 override with exe/meson.build b/test cases/native/201 override with exe/meson.build index 62d2f32a9..62d2f32a9 100644 --- a/test cases/common/201 override with exe/meson.build +++ b/test cases/native/201 override with exe/meson.build diff --git a/test cases/common/201 override with exe/subprojects/sub/foobar.c b/test cases/native/201 override with exe/subprojects/sub/foobar.c index c21d45028..c21d45028 100644 --- a/test cases/common/201 override with exe/subprojects/sub/foobar.c +++ b/test cases/native/201 override with exe/subprojects/sub/foobar.c diff --git a/test cases/common/201 override with exe/subprojects/sub/meson.build b/test cases/native/201 override with exe/subprojects/sub/meson.build index f0343b2c0..f0343b2c0 100644 --- a/test cases/common/201 override with exe/subprojects/sub/meson.build +++ b/test cases/native/201 override with exe/subprojects/sub/meson.build diff --git a/test cases/native/21 global arg/meson.build b/test cases/native/21 global arg/meson.build new file mode 100644 index 000000000..c303a02da --- /dev/null +++ b/test cases/native/21 global arg/meson.build @@ -0,0 +1,14 @@ +project('global arg test', 'cpp', 'c') + +add_global_arguments('-DMYTHING', language : 'c', native : true) +add_global_arguments('-DMYCPPTHING', language : 'cpp', native : true) +add_global_arguments('-DGLOBAL_BUILD', language : 'c', native : true) + +build_c_args = ['-DARG_BUILD'] +c_args = ['-DARG_HOST'] + +add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp'], native: true) + +exe1 = executable('prog1', 'prog.c', c_args : build_c_args, native : true) + +test('prog1', exe1) diff --git a/test cases/native/21 global arg/prog.c b/test cases/native/21 global arg/prog.c new file mode 100644 index 000000000..2a71236b6 --- /dev/null +++ b/test cases/native/21 global arg/prog.c @@ -0,0 +1,43 @@ +#ifndef MYTHING + #error "Global argument not set" +#endif + +#ifdef MYCPPTHING + #error "Wrong global argument set" +#endif + +#ifndef MYCANDCPPTHING + #error "Global argument not set" +#endif + +#if !defined(GLOBAL_HOST) && !defined(GLOBAL_BUILD) + #error "Neither global_host nor glogal_build is set." +#endif + +#if defined(GLOBAL_HOST) && defined(GLOBAL_BUILD) + #error "Both global build and global host set." +#endif + +#ifdef GLOBAL_BUILD + #ifndef ARG_BUILD + #error "Global is build but arg_build is not set." + #endif + + #ifdef ARG_HOST + #error "Global is build but arg host is set." + #endif +#endif + +#ifdef GLOBAL_HOST + #ifndef ARG_HOST + #error "Global is host but arg_host is not set." + #endif + + #ifdef ARG_BUILD + #error "Global is host but arg_build is set." + #endif +#endif + +int main(void) { + return 0; +} diff --git a/test cases/native/21 global arg/prog.cc b/test cases/native/21 global arg/prog.cc new file mode 100644 index 000000000..5c3220992 --- /dev/null +++ b/test cases/native/21 global arg/prog.cc @@ -0,0 +1,15 @@ +#ifdef MYTHING +#error "Wrong global argument set" +#endif + +#ifndef MYCPPTHING +#error "Global argument not set" +#endif + +#ifndef MYCANDCPPTHING +#error "Global argument not set" +#endif + +int main(void) { + return 0; +} diff --git a/test cases/common/27 pipeline/depends/copyrunner.py b/test cases/native/27 pipeline/depends/copyrunner.py index 0ef6a6d68..0ef6a6d68 100755 --- a/test cases/common/27 pipeline/depends/copyrunner.py +++ b/test cases/native/27 pipeline/depends/copyrunner.py diff --git a/test cases/common/27 pipeline/depends/filecopier.c b/test cases/native/27 pipeline/depends/filecopier.c index e10e4e773..e10e4e773 100644 --- a/test cases/common/27 pipeline/depends/filecopier.c +++ b/test cases/native/27 pipeline/depends/filecopier.c diff --git a/test cases/common/27 pipeline/depends/libsrc.c.in b/test cases/native/27 pipeline/depends/libsrc.c.in index 81805512f..81805512f 100644 --- a/test cases/common/27 pipeline/depends/libsrc.c.in +++ b/test cases/native/27 pipeline/depends/libsrc.c.in diff --git a/test cases/common/27 pipeline/depends/meson.build b/test cases/native/27 pipeline/depends/meson.build index 5111fee7a..5111fee7a 100644 --- a/test cases/common/27 pipeline/depends/meson.build +++ b/test cases/native/27 pipeline/depends/meson.build diff --git a/test cases/common/27 pipeline/depends/prog.c b/test cases/native/27 pipeline/depends/prog.c index 54c40e162..54c40e162 100644 --- a/test cases/common/27 pipeline/depends/prog.c +++ b/test cases/native/27 pipeline/depends/prog.c diff --git a/test cases/common/27 pipeline/input_src.dat b/test cases/native/27 pipeline/input_src.dat index a324dca21..a324dca21 100644 --- a/test cases/common/27 pipeline/input_src.dat +++ b/test cases/native/27 pipeline/input_src.dat diff --git a/test cases/common/27 pipeline/meson.build b/test cases/native/27 pipeline/meson.build index e12cb7b58..e12cb7b58 100644 --- a/test cases/common/27 pipeline/meson.build +++ b/test cases/native/27 pipeline/meson.build diff --git a/test cases/common/27 pipeline/prog.c b/test cases/native/27 pipeline/prog.c index 128f2bb15..128f2bb15 100644 --- a/test cases/common/27 pipeline/prog.c +++ b/test cases/native/27 pipeline/prog.c diff --git a/test cases/common/27 pipeline/src/input_src.dat b/test cases/native/27 pipeline/src/input_src.dat index 354499acd..354499acd 100644 --- a/test cases/common/27 pipeline/src/input_src.dat +++ b/test cases/native/27 pipeline/src/input_src.dat diff --git a/test cases/common/27 pipeline/src/meson.build b/test cases/native/27 pipeline/src/meson.build index 4e9ac116a..4e9ac116a 100644 --- a/test cases/common/27 pipeline/src/meson.build +++ b/test cases/native/27 pipeline/src/meson.build diff --git a/test cases/common/27 pipeline/src/prog.c b/test cases/native/27 pipeline/src/prog.c index 83121b5ef..83121b5ef 100644 --- a/test cases/common/27 pipeline/src/prog.c +++ b/test cases/native/27 pipeline/src/prog.c diff --git a/test cases/common/27 pipeline/src/srcgen.c b/test cases/native/27 pipeline/src/srcgen.c index 26761d225..26761d225 100644 --- a/test cases/common/27 pipeline/src/srcgen.c +++ b/test cases/native/27 pipeline/src/srcgen.c diff --git a/test cases/common/27 pipeline/srcgen.c b/test cases/native/27 pipeline/srcgen.c index ceb9eccee..ceb9eccee 100644 --- a/test cases/common/27 pipeline/srcgen.c +++ b/test cases/native/27 pipeline/srcgen.c diff --git a/test cases/common/36 tryrun/error.c b/test cases/native/36 tryrun/error.c index 53ef08e03..53ef08e03 100644 --- a/test cases/common/36 tryrun/error.c +++ b/test cases/native/36 tryrun/error.c diff --git a/test cases/common/36 tryrun/meson.build b/test cases/native/36 tryrun/meson.build index 558097451..558097451 100644 --- a/test cases/common/36 tryrun/meson.build +++ b/test cases/native/36 tryrun/meson.build diff --git a/test cases/common/36 tryrun/no_compile.c b/test cases/native/36 tryrun/no_compile.c index 496c2e837..496c2e837 100644 --- a/test cases/common/36 tryrun/no_compile.c +++ b/test cases/native/36 tryrun/no_compile.c diff --git a/test cases/common/36 tryrun/ok.c b/test cases/native/36 tryrun/ok.c index e2a36c8b5..e2a36c8b5 100644 --- a/test cases/common/36 tryrun/ok.c +++ b/test cases/native/36 tryrun/ok.c diff --git a/test cases/native/56 install script/file.txt b/test cases/native/56 install script/file.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test cases/native/56 install script/file.txt diff --git a/test cases/native/56 install script/meson.build b/test cases/native/56 install script/meson.build new file mode 100644 index 000000000..8a69a0d15 --- /dev/null +++ b/test cases/native/56 install script/meson.build @@ -0,0 +1,12 @@ +project('custom install script', 'c') + +# this is just to ensure that the install directory exists before exe is run +install_data('file.txt', install_dir: '.') + +subdir('src') + +meson.add_install_script(exe, 'generated.txt') +wrap = find_program('wrap.py') +# Yes, these are getting silly +meson.add_install_script(wrap, exe, 'wrapped.txt') +meson.add_install_script(wrap, wrap, exe, 'wrapped2.txt') diff --git a/test cases/common/56 install script/src/exe.c b/test cases/native/56 install script/src/exe.c index b573b9186..2df3ee885 100644 --- a/test cases/common/56 install script/src/exe.c +++ b/test cases/native/56 install script/src/exe.c @@ -15,6 +15,9 @@ int main(int argc, char * argv[]) { strcat(fullname, argv[1]); FILE * fp = fopen(fullname, "w"); + if (!fp) + return 1; + fputs("Some text\n", fp); fclose(fp); diff --git a/test cases/native/56 install script/src/meson.build b/test cases/native/56 install script/src/meson.build new file mode 100644 index 000000000..f60c995e3 --- /dev/null +++ b/test cases/native/56 install script/src/meson.build @@ -0,0 +1 @@ +exe = executable('exe', 'exe.c', install : false, native : true) diff --git a/test cases/native/56 install script/test.json b/test cases/native/56 install script/test.json new file mode 100644 index 000000000..c41c27c6a --- /dev/null +++ b/test cases/native/56 install script/test.json @@ -0,0 +1,8 @@ +{ + "installed": [ + {"type": "file", "file": "usr/file.txt"}, + {"type": "file", "file": "usr/generated.txt"}, + {"type": "file", "file": "usr/wrapped.txt"}, + {"type": "file", "file": "usr/wrapped2.txt"} + ] +} diff --git a/test cases/common/56 install script/wrap.py b/test cases/native/56 install script/wrap.py index 87508e008..87508e008 100755 --- a/test cases/common/56 install script/wrap.py +++ b/test cases/native/56 install script/wrap.py diff --git a/test cases/native/85 add language/meson.build b/test cases/native/85 add language/meson.build new file mode 100644 index 000000000..a7aad7367 --- /dev/null +++ b/test cases/native/85 add language/meson.build @@ -0,0 +1,3 @@ +project('add language', 'c') +assert(add_languages('cpp', native: true), 'Add_languages returned false on success') +test('C++', executable('cppprog', 'prog.cc', native: true)) diff --git a/test cases/native/85 add language/prog.cc b/test cases/native/85 add language/prog.cc new file mode 100644 index 000000000..03647dde4 --- /dev/null +++ b/test cases/native/85 add language/prog.cc @@ -0,0 +1,6 @@ +#include<iostream> + +int main(int, char**) { + std::cout << "I am C++.\n"; + return 0; +} diff --git a/test cases/common/93 selfbuilt custom/checkarg.cpp b/test cases/native/93 selfbuilt custom/checkarg.cpp index 99092eea0..99092eea0 100644 --- a/test cases/common/93 selfbuilt custom/checkarg.cpp +++ b/test cases/native/93 selfbuilt custom/checkarg.cpp diff --git a/test cases/common/93 selfbuilt custom/data.dat b/test cases/native/93 selfbuilt custom/data.dat index 83fd1d90d..83fd1d90d 100644 --- a/test cases/common/93 selfbuilt custom/data.dat +++ b/test cases/native/93 selfbuilt custom/data.dat diff --git a/test cases/common/93 selfbuilt custom/mainprog.cpp b/test cases/native/93 selfbuilt custom/mainprog.cpp index bb45dcae8..bb45dcae8 100644 --- a/test cases/common/93 selfbuilt custom/mainprog.cpp +++ b/test cases/native/93 selfbuilt custom/mainprog.cpp diff --git a/test cases/common/93 selfbuilt custom/meson.build b/test cases/native/93 selfbuilt custom/meson.build index b53635218..b53635218 100644 --- a/test cases/common/93 selfbuilt custom/meson.build +++ b/test cases/native/93 selfbuilt custom/meson.build diff --git a/test cases/common/93 selfbuilt custom/tool.cpp b/test cases/native/93 selfbuilt custom/tool.cpp index 6a28dd800..6a28dd800 100644 --- a/test cases/common/93 selfbuilt custom/tool.cpp +++ b/test cases/native/93 selfbuilt custom/tool.cpp |
