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

Commit 5dfa9637 authored by Aditya Choudhary's avatar Aditya Choudhary
Browse files

Add test spec provider to test modules.

Provider added for the following test modules in this change: art_cc_test, cc_benchmark, cc_fuzz, cc_test, cc_test_host, rust_test,and rust_test_host.

Bug: 296873595
Test: Manual test
Change-Id: I815680529bcbecacb3a2bdb8f3746053afdee48c
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of: aosp/2836758

Change-Id: Ib9887d0546690355d40facdd3721d7905f5a55df
Merged-In: I815680529bcbecacb3a2bdb8f3746053afdee48c
parent 57011173
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()
}

+3 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ func init() {
func TestFactory() android.Module {
	module := NewTest(android.HostAndDeviceSupported, true)
	module.bazelHandler = &ccTestBazelHandler{module: module}
	module.testModule = true
	return module.Init()
}

@@ -154,12 +155,14 @@ func TestLibraryFactory() android.Module {
// binary.
func BenchmarkFactory() android.Module {
	module := NewBenchmark(android.HostAndDeviceSupported)
	module.testModule = true
	return module.Init()
}

// cc_test_host compiles a test host binary.
func TestHostFactory() android.Module {
	module := NewTest(android.HostSupported, true)
	module.testModule = true
	return module.Init()
}

+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ bootstrap_go_package {
        "soong-cc",
        "soong-rust-config",
        "soong-snapshot",
        "soong-testing",
    ],
    srcs: [
        "afdo.go",
Loading