summaryrefslogtreecommitdiff
path: root/rust/fuzz_test.go
diff options
context:
space:
mode:
authorTri Vo <trong@google.com>2021-04-08 15:50:48 -0700
committerTri Vo <trong@google.com>2021-04-13 15:58:44 -0700
commit505b0e8991709396fb959823e04c8cfe73163bf3 (patch)
treee7ab233164a58356f06d6bbc4d5e49c843e8ce82 /rust/fuzz_test.go
parentc8ae73e67825200efa8458f594115b1dcd7773ce (diff)
rust: Switch rust_fuzz to HWASan
Bug: 180495975 Test: example_rust_fuzzer Change-Id: I26e6f15136ee2d5f4ed1167be5c1c6a14b19421a
Diffstat (limited to 'rust/fuzz_test.go')
-rw-r--r--rust/fuzz_test.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/rust/fuzz_test.go b/rust/fuzz_test.go
index f93ccc79f..2524f9176 100644
--- a/rust/fuzz_test.go
+++ b/rust/fuzz_test.go
@@ -37,9 +37,6 @@ func TestRustFuzz(t *testing.T) {
// Check that appropriate dependencies are added and that the rustlib linkage is correct.
fuzz_libtest_mod := ctx.ModuleForTests("fuzz_libtest", "android_arm64_armv8-a_fuzzer").Module().(*Module)
- if !android.InList("libclang_rt.asan-aarch64-android", fuzz_libtest_mod.Properties.AndroidMkSharedLibs) {
- t.Errorf("libclang_rt.asan-aarch64-android shared library dependency missing for rust_fuzz module.")
- }
if !android.InList("liblibfuzzer_sys.rlib-std", fuzz_libtest_mod.Properties.AndroidMkRlibs) {
t.Errorf("liblibfuzzer_sys rlib library dependency missing for rust_fuzz module. %#v", fuzz_libtest_mod.Properties.AndroidMkRlibs)
}
@@ -49,18 +46,18 @@ func TestRustFuzz(t *testing.T) {
// Check that compiler flags are set appropriately .
fuzz_libtest := ctx.ModuleForTests("fuzz_libtest", "android_arm64_armv8-a_fuzzer").Output("fuzz_libtest")
- if !strings.Contains(fuzz_libtest.Args["rustcFlags"], "-Z sanitizer=address") ||
+ if !strings.Contains(fuzz_libtest.Args["rustcFlags"], "-Z sanitizer=hwaddress") ||
!strings.Contains(fuzz_libtest.Args["rustcFlags"], "-C passes='sancov'") ||
!strings.Contains(fuzz_libtest.Args["rustcFlags"], "--cfg fuzzing") {
- t.Errorf("rust_fuzz module does not contain the expected flags (sancov, cfg fuzzing, address sanitizer).")
+ t.Errorf("rust_fuzz module does not contain the expected flags (sancov, cfg fuzzing, hwaddress sanitizer).")
}
// 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=address") ||
+ if !strings.Contains(libtest_fuzzer.Args["rustcFlags"], "-Z sanitizer=hwaddress") ||
!strings.Contains(libtest_fuzzer.Args["rustcFlags"], "-C passes='sancov'") ||
!strings.Contains(libtest_fuzzer.Args["rustcFlags"], "--cfg fuzzing") {
- t.Errorf("rust_fuzz dependent library does not contain the expected flags (sancov, cfg fuzzing, address sanitizer).")
+ t.Errorf("rust_fuzz dependent library does not contain the expected flags (sancov, cfg fuzzing, hwaddress sanitizer).")
}
}