rusticl: add Test targets

v2: Add more targets and a little test lib to add stubs for missing symbols
v3: Condition building tests on a recent enough meson (@leftmostcat)
v4: Set suite parameter for new tests (@leftmostcat)

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35188>
This commit is contained in:
norablackcat
2025-01-24 17:00:45 -06:00
committed by Marge Bot
parent 6af462b27f
commit ccf099d0d1
2 changed files with 33 additions and 0 deletions
+27
View File
@@ -441,3 +441,30 @@ librusticl = static_library(
rusticl_proc_macros,
],
)
if meson.version().version_compare('>= 1.9.0') and with_tests
# Tests may fail to build with versions of meson prior to 1.9 due to a bug
# involving parameters passed to the linker.
#
# See https://github.com/mesonbuild/meson/issues/14622
librusticl_test = static_library(
'rusticl_test',
'test/lib.rs',
rust_abi : 'c',
)
rust.test('rusticl_opencl_gen_test', rusticl_opencl_gen, suite : ['rusticl'])
rust.test('rusticl_llvm_gen_test', rusticl_llvm_gen, suite : ['rusticl'])
rust.test('rusticl_proc_macros_test', rusticl_proc_macros, suite : ['rusticl'])
rust.test('libc_rust_gen_test', libc_rust_gen, suite : ['rusticl'])
rust.test('libmesa_rust_gen_test', libmesa_rust_gen, suite : ['rusticl'])
rust.test('libmesa_rust_util_test', libmesa_rust_util, suite : ['rusticl'])
rust.test('libmesa_rust_test', libmesa_rust, suite : ['rusticl'])
rust.test('rusticl_test', librusticl,
link_with : [
librusticl_test,
],
suite : ['rusticl'],
)
endif
@@ -0,0 +1,6 @@
use std::ffi::{c_int, c_void};
// it's never called anyway, but the linker _might_ think that. If this interface ever changes it
// might cause random issues, but... I also don't really care all that much until it happens.
#[no_mangle]
extern "C" fn pipe_loader_release(_: *mut *mut c_void, _: c_int) {}