Support native tests in crossbuild
This commit is contained in:
parent
7437d9862a
commit
b8052f9e50
|
@ -650,7 +650,7 @@ class SingleTestRunner:
|
||||||
return ['java', '-jar'] + self.test.fname
|
return ['java', '-jar'] + self.test.fname
|
||||||
elif not self.test.is_cross_built and run_with_mono(self.test.fname[0]):
|
elif not self.test.is_cross_built and run_with_mono(self.test.fname[0]):
|
||||||
return ['mono'] + self.test.fname
|
return ['mono'] + self.test.fname
|
||||||
elif self.test.cmd_is_built and self.test.needs_exe_wrapper:
|
elif self.test.cmd_is_built and self.test.is_cross_built and self.test.needs_exe_wrapper:
|
||||||
if self.test.exe_runner is None:
|
if self.test.exe_runner is None:
|
||||||
# Can not run test on cross compiled executable
|
# Can not run test on cross compiled executable
|
||||||
# because there is no execute wrapper.
|
# because there is no execute wrapper.
|
||||||
|
|
|
@ -7507,6 +7507,19 @@ class LinuxCrossArmTests(BaseLinuxCrossTests):
|
||||||
'-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'),
|
'-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'),
|
||||||
'-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'),
|
'-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def test_run_native_test(self):
|
||||||
|
'''
|
||||||
|
https://github.com/mesonbuild/meson/issues/7997
|
||||||
|
check run native test in crossbuild without exe wrapper
|
||||||
|
'''
|
||||||
|
testdir = os.path.join(self.unit_test_dir, '88 run native test')
|
||||||
|
stamp_file = os.path.join(self.builddir, 'native_test_has_run.stamp')
|
||||||
|
self.init(testdir)
|
||||||
|
self.build()
|
||||||
|
self.assertPathDoesNotExist(stamp_file)
|
||||||
|
self.run_tests()
|
||||||
|
self.assertPathExists(stamp_file)
|
||||||
|
|
||||||
|
|
||||||
def should_run_cross_mingw_tests():
|
def should_run_cross_mingw_tests():
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main (int argc, char * argv[])
|
||||||
|
{
|
||||||
|
const char *out = "SUCCESS!";
|
||||||
|
|
||||||
|
if (argc != 2) {
|
||||||
|
printf ("%s\n", out);
|
||||||
|
} else {
|
||||||
|
int ret;
|
||||||
|
FILE *f = fopen (argv[1], "w");
|
||||||
|
ret = fwrite (out, sizeof (out), 1, f);
|
||||||
|
if (ret != 1)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
project('run native test', ['c'])
|
||||||
|
|
||||||
|
executable('terget_exe', 'main.c')
|
||||||
|
|
||||||
|
native_exe = executable('native_exe', 'main.c', native: true)
|
||||||
|
test('native_exe', native_exe, args: ['native_test_has_run.stamp'])
|
Loading…
Reference in New Issue