summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cc/fuzz.go2
-rw-r--r--cc/test.go8
-rw-r--r--fuzz/fuzz_common.go8
-rw-r--r--java/fuzz.go18
4 files changed, 15 insertions, 21 deletions
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 8a974c0f0..26ac7d1b8 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -350,6 +350,8 @@ func PackageFuzzModule(ctx android.ModuleContext, fuzzPackagedModule fuzz.FuzzPa
fuzzPackagedModule.Corpus = append(fuzzPackagedModule.Corpus, android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Device_common_corpus)...)
fuzzPackagedModule.Data = android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Data)
+ fuzzPackagedModule.Data = append(fuzzPackagedModule.Data, android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Device_common_data)...)
+ fuzzPackagedModule.Data = append(fuzzPackagedModule.Data, android.PathsForModuleSrc(ctx, fuzzPackagedModule.FuzzProperties.Device_first_data)...)
if fuzzPackagedModule.FuzzProperties.Dictionary != nil {
fuzzPackagedModule.Dictionary = android.PathForModuleSrc(ctx, *fuzzPackagedModule.FuzzProperties.Dictionary)
diff --git a/cc/test.go b/cc/test.go
index ae7388628..abec19a51 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -83,14 +83,14 @@ type TestBinaryProperties struct {
// the test
Data []string `android:"path,arch_variant"`
- // Same as data, but adds depedencies on modules using the device's os variant, and common
+ // Same as data, but adds dependencies on modules using the device's os variant, and common
// architecture's variant. Can be useful to add device-built apps to the data of a host
// test.
Device_common_data []string `android:"path_device_common"`
- // Same as data, but adds depedencies on modules using the device's os variant, and the device's
- // first architecture's variant. Can be useful to add device-built apps to the data of a host
- // test.
+ // Same as data, but adds dependencies on modules using the device's os variant, and the
+ // device's first architecture's variant. Can be useful to add device-built apps to the data
+ // of a host test.
Device_first_data []string `android:"path_device_first"`
// list of shared library modules that should be installed alongside the test
diff --git a/fuzz/fuzz_common.go b/fuzz/fuzz_common.go
index aa393a2d5..3fd79a719 100644
--- a/fuzz/fuzz_common.go
+++ b/fuzz/fuzz_common.go
@@ -419,6 +419,14 @@ type FuzzProperties struct {
// Optional list of data files to be installed to the fuzz target's output
// directory. Directory structure relative to the module is preserved.
Data []string `android:"path"`
+ // Same as data, but adds dependencies on modules using the device's os variant, and common
+ // architecture's variant. Can be useful to add device-built apps to the data of a host
+ // test.
+ Device_common_data []string `android:"path_device_common"`
+ // Same as data, but adds dependencies on modules using the device's os variant, and the
+ // device's first architecture's variant. Can be useful to add device-built apps to the data
+ // of a host test.
+ Device_first_data []string `android:"path_device_first"`
// Optional dictionary to be installed to the fuzz target's output directory.
Dictionary *string `android:"path"`
// Define the fuzzing frameworks this fuzz target can be built for. If
diff --git a/java/fuzz.go b/java/fuzz.go
index 90f09a899..dba8815ed 100644
--- a/java/fuzz.go
+++ b/java/fuzz.go
@@ -107,23 +107,7 @@ func (j *JavaFuzzTest) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (j *JavaFuzzTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- if j.fuzzPackagedModule.FuzzProperties.Corpus != nil {
- j.fuzzPackagedModule.Corpus = android.PathsForModuleSrc(ctx, j.fuzzPackagedModule.FuzzProperties.Corpus)
- }
- if j.fuzzPackagedModule.FuzzProperties.Device_common_corpus != nil {
- j.fuzzPackagedModule.Corpus = append(j.fuzzPackagedModule.Corpus, android.PathsForModuleSrc(ctx, j.fuzzPackagedModule.FuzzProperties.Device_common_corpus)...)
- }
- if j.fuzzPackagedModule.FuzzProperties.Data != nil {
- j.fuzzPackagedModule.Data = android.PathsForModuleSrc(ctx, j.fuzzPackagedModule.FuzzProperties.Data)
- }
- if j.fuzzPackagedModule.FuzzProperties.Dictionary != nil {
- j.fuzzPackagedModule.Dictionary = android.PathForModuleSrc(ctx, *j.fuzzPackagedModule.FuzzProperties.Dictionary)
- }
- if j.fuzzPackagedModule.FuzzProperties.Fuzz_config != nil {
- configPath := android.PathForModuleOut(ctx, "config").Join(ctx, "config.json")
- android.WriteFileRule(ctx, configPath, j.fuzzPackagedModule.FuzzProperties.Fuzz_config.String())
- j.fuzzPackagedModule.Config = configPath
- }
+ j.fuzzPackagedModule = cc.PackageFuzzModule(ctx, j.fuzzPackagedModule, pctx)
_, sharedDeps := cc.CollectAllSharedDependencies(ctx)
for _, dep := range sharedDeps {