Merge "Add test spec provider to test modules." into main am: bc34d495c9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2836758 Change-Id: I98d9c51c8ffab2ec0e9a6451e0637eea07e23727 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
0c6c5f5431
7 changed files with 23 additions and 5 deletions
|
@ -19,6 +19,7 @@ bootstrap_go_package {
|
||||||
"soong-multitree",
|
"soong-multitree",
|
||||||
"soong-snapshot",
|
"soong-snapshot",
|
||||||
"soong-sysprop-bp2build",
|
"soong-sysprop-bp2build",
|
||||||
|
"soong-testing",
|
||||||
"soong-tradefed",
|
"soong-tradefed",
|
||||||
],
|
],
|
||||||
srcs: [
|
srcs: [
|
||||||
|
|
11
cc/cc.go
11
cc/cc.go
|
@ -24,6 +24,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"android/soong/testing"
|
||||||
"android/soong/ui/metrics/bp2build_metrics_proto"
|
"android/soong/ui/metrics/bp2build_metrics_proto"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
|
@ -862,9 +863,10 @@ type Module struct {
|
||||||
Properties BaseProperties
|
Properties BaseProperties
|
||||||
|
|
||||||
// initialize before calling Init
|
// initialize before calling Init
|
||||||
hod android.HostOrDeviceSupported
|
hod android.HostOrDeviceSupported
|
||||||
multilib android.Multilib
|
multilib android.Multilib
|
||||||
bazelable bool
|
bazelable bool
|
||||||
|
testModule bool
|
||||||
|
|
||||||
// Allowable SdkMemberTypes of this module type.
|
// Allowable SdkMemberTypes of this module type.
|
||||||
sdkMemberTypes []android.SdkMemberType
|
sdkMemberTypes []android.SdkMemberType
|
||||||
|
@ -2329,6 +2331,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c.testModule {
|
||||||
|
ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
|
||||||
|
}
|
||||||
|
|
||||||
c.maybeInstall(ctx, apexInfo)
|
c.maybeInstall(ctx, apexInfo)
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ func fuzzMutatorDeps(mctx android.TopDownMutatorContext) {
|
||||||
// your device, or $ANDROID_PRODUCT_OUT/data/fuzz in your build tree.
|
// your device, or $ANDROID_PRODUCT_OUT/data/fuzz in your build tree.
|
||||||
func LibFuzzFactory() android.Module {
|
func LibFuzzFactory() android.Module {
|
||||||
module := NewFuzzer(android.HostAndDeviceSupported)
|
module := NewFuzzer(android.HostAndDeviceSupported)
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@ func init() {
|
||||||
func TestFactory() android.Module {
|
func TestFactory() android.Module {
|
||||||
module := NewTest(android.HostAndDeviceSupported, true)
|
module := NewTest(android.HostAndDeviceSupported, true)
|
||||||
module.bazelHandler = &ccTestBazelHandler{module: module}
|
module.bazelHandler = &ccTestBazelHandler{module: module}
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,12 +159,14 @@ func TestLibraryFactory() android.Module {
|
||||||
// binary.
|
// binary.
|
||||||
func BenchmarkFactory() android.Module {
|
func BenchmarkFactory() android.Module {
|
||||||
module := NewBenchmark(android.HostAndDeviceSupported)
|
module := NewBenchmark(android.HostAndDeviceSupported)
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// cc_test_host compiles a test host binary.
|
// cc_test_host compiles a test host binary.
|
||||||
func TestHostFactory() android.Module {
|
func TestHostFactory() android.Module {
|
||||||
module := NewTest(android.HostSupported, true)
|
module := NewTest(android.HostSupported, true)
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ bootstrap_go_package {
|
||||||
"soong-cc",
|
"soong-cc",
|
||||||
"soong-rust-config",
|
"soong-rust-config",
|
||||||
"soong-snapshot",
|
"soong-snapshot",
|
||||||
|
"soong-testing",
|
||||||
],
|
],
|
||||||
srcs: [
|
srcs: [
|
||||||
"afdo.go",
|
"afdo.go",
|
||||||
|
|
|
@ -20,6 +20,7 @@ import (
|
||||||
|
|
||||||
"android/soong/bazel"
|
"android/soong/bazel"
|
||||||
"android/soong/bloaty"
|
"android/soong/bloaty"
|
||||||
|
"android/soong/testing"
|
||||||
"android/soong/ui/metrics/bp2build_metrics_proto"
|
"android/soong/ui/metrics/bp2build_metrics_proto"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
|
@ -144,8 +145,9 @@ type Module struct {
|
||||||
|
|
||||||
Properties BaseProperties
|
Properties BaseProperties
|
||||||
|
|
||||||
hod android.HostOrDeviceSupported
|
hod android.HostOrDeviceSupported
|
||||||
multilib android.Multilib
|
multilib android.Multilib
|
||||||
|
testModule bool
|
||||||
|
|
||||||
makeLinkType string
|
makeLinkType string
|
||||||
|
|
||||||
|
@ -1038,6 +1040,9 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||||
|
|
||||||
ctx.Phony("rust", ctx.RustModule().OutputFile().Path())
|
ctx.Phony("rust", ctx.RustModule().OutputFile().Path())
|
||||||
}
|
}
|
||||||
|
if mod.testModule {
|
||||||
|
ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mod *Module) deps(ctx DepsContext) Deps {
|
func (mod *Module) deps(ctx DepsContext) Deps {
|
||||||
|
|
|
@ -222,11 +222,13 @@ func RustTestFactory() android.Module {
|
||||||
// rustTestHostMultilib load hook to set MultilibFirst for the
|
// rustTestHostMultilib load hook to set MultilibFirst for the
|
||||||
// host target.
|
// host target.
|
||||||
android.AddLoadHook(module, rustTestHostMultilib)
|
android.AddLoadHook(module, rustTestHostMultilib)
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
func RustTestHostFactory() android.Module {
|
func RustTestHostFactory() android.Module {
|
||||||
module, _ := NewRustTest(android.HostSupported)
|
module, _ := NewRustTest(android.HostSupported)
|
||||||
|
module.testModule = true
|
||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue