diff options
-rwxr-xr-x | run_cross_test.py | 2 | ||||
-rwxr-xr-x | run_project_tests.py | 3 | ||||
-rwxr-xr-x | run_unittests.py | 2 | ||||
-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 |
56 files changed, 131 insertions, 34 deletions
diff --git a/run_cross_test.py b/run_cross_test.py index 1e67876..269eb01 100755 --- a/run_cross_test.py +++ b/run_cross_test.py @@ -26,7 +26,7 @@ from mesonbuild.coredata import version as meson_version def runtests(cross_file, failfast): - tests = ['--only', 'common'] + tests = ['--only', 'common', 'native'] cmd = mesonlib.python_command + ['run_project_tests.py', '--backend', 'ninja'] + (['--failfast'] if failfast else []) + tests + ['--cross-file', cross_file] return subprocess.call(cmd) diff --git a/run_project_tests.py b/run_project_tests.py index 4566de1..7b7ba11 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -50,7 +50,7 @@ from run_tests import get_backend_commands, get_backend_args_for_dir, Backend from run_tests import ensure_backend_detects_changes from run_tests import guess_backend -ALL_TESTS = ['cmake', 'common', 'warning-meson', 'failing-meson', 'failing-build', 'failing-test', +ALL_TESTS = ['cmake', 'common', 'native', 'warning-meson', 'failing-meson', 'failing-build', 'failing-test', 'keyval', 'platform-osx', 'platform-windows', 'platform-linux', 'java', 'C#', 'vala', 'rust', 'd', 'objective c', 'objective c++', 'fortran', 'swift', 'cuda', 'python3', 'python', 'fpga', 'frameworks', 'nasm', 'wasm' @@ -961,6 +961,7 @@ def detect_tests_to_run(only: T.List[str], use_tmp: bool) -> T.List[T.Tuple[str, all_tests = [ TestCategory('cmake', 'cmake', not shutil.which('cmake') or (os.environ.get('compiler') == 'msvc2015' and under_ci)), TestCategory('common', 'common'), + TestCategory('native', 'native'), TestCategory('warning-meson', 'warning', stdout_mandatory=True), TestCategory('failing-meson', 'failing', stdout_mandatory=True), TestCategory('failing-build', 'failing build'), diff --git a/run_unittests.py b/run_unittests.py index efe1e29..b76e489 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -6928,7 +6928,7 @@ class LinuxlikeTests(BasePlatformTests): ''' Test that we produce the correct dependencies when a program is overridden with an executable. ''' - testdir = os.path.join(self.common_test_dir, '201 override with exe') + testdir = os.path.join(self.src_root, 'test cases', 'native', '201 override with exe') self.init(testdir) with open(os.path.join(self.builddir, 'build.ninja')) as bfile: for line in bfile: 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 cd91584..cd91584 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 68f9993..68f9993 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 fa3dfca..fa3dfca 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 2a5625a..2a5625a 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 fb1142c..2e424d5 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 5add17e..2a1c736 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 e80e666..696e3f6 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 1db424f..123fe18 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 b2a5971..3804fe1 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 aa4972a..e99f33a 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 0000000..f6c5d4d --- /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 0000000..96612d4 --- /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 40e30d4..40e30d4 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 48b080e..48b080e 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 c1cc5af..c1cc5af 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 77ff909..77ff909 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 e69de29..e69de29 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 62d2f32..62d2f32 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 c21d450..c21d450 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 f0343b2..f0343b2 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 0000000..c303a02 --- /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 0000000..2a71236 --- /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 0000000..5c32209 --- /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 0ef6a6d..0ef6a6d 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 e10e4e7..e10e4e7 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 8180551..8180551 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 5111fee..5111fee 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 54c40e1..54c40e1 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 a324dca..a324dca 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 e12cb7b..e12cb7b 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 128f2bb..128f2bb 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 354499a..354499a 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 4e9ac11..4e9ac11 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 83121b5..83121b5 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 26761d2..26761d2 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 ceb9ecc..ceb9ecc 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 53ef08e..53ef08e 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 5580974..5580974 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 496c2e8..496c2e8 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 e2a36c8..e2a36c8 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 0000000..e69de29 --- /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 0000000..8a69a0d --- /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 b573b91..2df3ee8 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 0000000..f60c995 --- /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 0000000..c41c27c --- /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 87508e0..87508e0 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 0000000..a7aad73 --- /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 0000000..03647dd --- /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 99092ee..99092ee 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 83fd1d9..83fd1d9 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 bb45dca..bb45dca 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 b536352..b536352 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 6a28dd8..6a28dd8 100644 --- a/test cases/common/93 selfbuilt custom/tool.cpp +++ b/test cases/native/93 selfbuilt custom/tool.cpp |