Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4025ba3d authored by Aditya Choudhary's avatar Aditya Choudhary Committed by Android (Google) Code Review
Browse files

Merge changes from topic "test_metadata_cp-udc-mainline-prod" into udc-mainline-prod

* changes:
  Use result.Config.PrebuiltOS() to get prebuiltHost in test_spec_test
  Add test for soong/testing/test_spec.
  Set testModule to true in cc.NewTest().
  Add Singleton class to collect and validate test spec metadata.
  Add test spec provider to test modules.
  Add proto for Test ownership metadata.
parents df88173d 5202fc91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ bootstrap_go_package {
        "soong-genrule",
        "soong-multitree",
        "soong-snapshot",
        "soong-testing",
        "soong-tradefed",
    ],
    srcs: [
+8 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import (
	"strconv"
	"strings"

	"android/soong/testing"
	"github.com/google/blueprint"
	"github.com/google/blueprint/proptools"

@@ -838,6 +839,7 @@ type Module struct {
	hod        android.HostOrDeviceSupported
	multilib   android.Multilib
	bazelable  bool
	testModule bool

	// Allowable SdkMemberTypes of this module type.
	sdkMemberTypes []android.SdkMemberType
@@ -2104,6 +2106,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
			}
		}
	}
	if c.testModule {
		ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
	}

	c.maybeInstall(ctx, apexInfo)
}
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ func fuzzMutatorDeps(mctx android.TopDownMutatorContext) {
// your device, or $ANDROID_PRODUCT_OUT/data/fuzz in your build tree.
func LibFuzzFactory() android.Module {
	module := NewFuzzer(android.HostAndDeviceSupported)
	module.testModule = true
	return module.Init()
}

+2 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ func TestLibraryFactory() android.Module {
// binary.
func BenchmarkFactory() android.Module {
	module := NewBenchmark(android.HostAndDeviceSupported)
	module.testModule = true
	return module.Init()
}

@@ -482,6 +483,7 @@ func NewTest(hod android.HostOrDeviceSupported, bazelable bool) *Module {
	module, binary := newBinary(hod, bazelable)
	module.bazelable = bazelable
	module.multilib = android.MultilibBoth
	module.testModule = true
	binary.baseInstaller = NewTestInstaller()

	test := &testBinary{
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ bootstrap_go_package {
        "soong-dexpreopt",
        "soong-genrule",
        "soong-java-config",
        "soong-testing",
        "soong-provenance",
        "soong-python",
        "soong-remoteexec",
@@ -109,6 +110,7 @@ bootstrap_go_package {
        "sdk_library_test.go",
        "system_modules_test.go",
        "systemserver_classpath_fragment_test.go",
        "test_spec_test.go",
    ],
    pluginFor: ["soong_build"],
}
Loading