Improve cc tests by adding fuzzer mutators
This fixes an issue that arises when deduping cc build component
registration code.
The fuzzer and fuzzer_deps post deps mutators were not previously
added when running cc tests. That meant the tests were not actually
testing the same behavior as at runtime.
Adding the mutators breaks the TestFuzzTarget test as the mutator
changes the variant of the fuzz_smoke_test that is created and so the
test fails to find it.
This fixes the test by correct the variant name.
Test: m checkbuild
Bug: 146540677
Change-Id: I9d2be0023affb7722f0399663fa18a2a5fb610d8
diff --git a/cc/testing.go b/cc/testing.go
index 245325b..5fcad29 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -36,6 +36,9 @@
ctx.BottomUp("sysprop_cc", SyspropMutator).Parallel()
})
ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
+ ctx.TopDown("fuzzer_deps", sanitizerDepsMutator(fuzzer))
+ ctx.BottomUp("fuzzer", sanitizerMutator(fuzzer)).Parallel()
+
ctx.TopDown("sanitize_runtime_deps", sanitizerRuntimeDepsMutator).Parallel()
ctx.BottomUp("sanitize_runtime", sanitizerRuntimeMutator).Parallel()
})