diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-11-08 12:06:45 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-12 14:56:22 -0800 |
| commit | b207b2744ae90fb9c599b534e10ecf39f50c9b2c (patch) | |
| tree | 0216584d5d4d7def4064b3ca9651fc37cf4ef0f4 /unittests | |
| parent | 375154f964d14bde4982a15659fe2df81b571261 (diff) | |
| download | meson-b207b2744ae90fb9c599b534e10ecf39f50c9b2c.tar.gz | |
rust: allow linking with sanitizer-enabled C libraries
Fixes: #15222
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests')
| -rw-r--r-- | unittests/linuxliketests.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 60069acb5..8ab99d936 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -1968,6 +1968,23 @@ class LinuxlikeTests(BasePlatformTests): self.check_has_flag(compdb, sub1src, '-O2') self.check_has_flag(compdb, sub2src, '-O2') + @skip_if_not_language('rust') + @skip_if_not_base_option('b_sanitize') + def test_rust_sanitizers(self): + args = ['-Drust_nightly=disabled', '-Db_lundef=false'] + testdir = os.path.join(self.rust_test_dir, '28 mixed') + tests = ['address'] + + env = get_fake_env(testdir, self.builddir, self.prefix) + cpp = detect_cpp_compiler(env, MachineChoice.HOST) + if cpp.find_library('ubsan', env, []): + tests += ['address,undefined'] + + for value in tests: + self.init(testdir, extra_args=args + ['-Db_sanitize=' + value]) + self.build() + self.wipe() + def test_sanitizers(self): testdir = os.path.join(self.unit_test_dir, '128 sanitizers') |
