diff options
author | 2023-05-24 15:53:43 +0000 | |
---|---|---|
committer | 2023-05-24 20:15:52 +0000 | |
commit | 7f9d7cbb7547aa65e0ac1d2a3415112ca61a6649 (patch) | |
tree | e846d0e580c93d43572a9f7d9ffe5f794fe1e9ce /rust/fuzz_test.go | |
parent | cd4e6a609e5c3f0c6895893c70ddbed008249c74 (diff) |
rust: Support sanitizers in rust_ffi modules
Don't automatically assume that HWASAN or ASAN is enabled if Fuzzer is
enabled.
Bug: 178365482
Test: m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=fuzzer m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=address m bluetooth_stack_with_facade
Test: SANITIZE_TARGET=hwaddress m bluetooth_stack_with_facade
Test: SANITIZE_TARGET="fuzzer address" m bluetooth_stack_with_facade
Test: SANITIZE_TARGET="fuzzer hwaddress" m bluetooth_stack_with_facade
Change-Id: Ief8c0f899837c5889a8035782616025f1b0d54e7
Diffstat (limited to 'rust/fuzz_test.go')
-rw-r--r-- | rust/fuzz_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/rust/fuzz_test.go b/rust/fuzz_test.go index 865665eef..7fa9f5c8f 100644 --- a/rust/fuzz_test.go +++ b/rust/fuzz_test.go @@ -46,18 +46,16 @@ func TestRustFuzz(t *testing.T) { // Check that compiler flags are set appropriately . fuzz_libtest := ctx.ModuleForTests("fuzz_libtest", "android_arm64_armv8-a_fuzzer").Rule("rustc") - if !strings.Contains(fuzz_libtest.Args["rustcFlags"], "-Z sanitizer=hwaddress") || - !strings.Contains(fuzz_libtest.Args["rustcFlags"], "-C passes='sancov-module'") || + if !strings.Contains(fuzz_libtest.Args["rustcFlags"], "-C passes='sancov-module'") || !strings.Contains(fuzz_libtest.Args["rustcFlags"], "--cfg fuzzing") { - t.Errorf("rust_fuzz module does not contain the expected flags (sancov-module, cfg fuzzing, hwaddress sanitizer).") + t.Errorf("rust_fuzz module does not contain the expected flags (sancov-module, cfg fuzzing).") } // Check that dependencies have 'fuzzer' variants produced for them as well. libtest_fuzzer := ctx.ModuleForTests("libtest_fuzzing", "android_arm64_armv8-a_rlib_rlib-std_fuzzer").Output("libtest_fuzzing.rlib") - if !strings.Contains(libtest_fuzzer.Args["rustcFlags"], "-Z sanitizer=hwaddress") || - !strings.Contains(libtest_fuzzer.Args["rustcFlags"], "-C passes='sancov-module'") || + if !strings.Contains(libtest_fuzzer.Args["rustcFlags"], "-C passes='sancov-module'") || !strings.Contains(libtest_fuzzer.Args["rustcFlags"], "--cfg fuzzing") { - t.Errorf("rust_fuzz dependent library does not contain the expected flags (sancov-module, cfg fuzzing, hwaddress sanitizer).") + t.Errorf("rust_fuzz dependent library does not contain the expected flags (sancov-module, cfg fuzzing).") } } |