Expose ProductVariables from TestConfig

am: 674dc7f7f0

Change-Id: I130d3425854c56f9e53793140e1aaa76accab619
This commit is contained in:
Dan Willemsen 2018-04-10 18:52:38 -07:00 committed by android-build-merger
commit e4436b5ab2
4 changed files with 13 additions and 9 deletions

View file

@ -69,6 +69,9 @@ type config struct {
FileConfigurableOptions
ProductVariables productVariables
// Only available on configs created by TestConfig
TestProductVariables *productVariables
PrimaryBuilder string
ConfigFileName string
ProductVariablesFileName string
@ -197,6 +200,7 @@ func TestConfig(buildDir string, env map[string]string) Config {
config.deviceConfig = &deviceConfig{
config: config,
}
config.TestProductVariables = &config.ProductVariables
if err := config.fromEnv(); err != nil {
panic(err)

View file

@ -188,8 +188,8 @@ func testCcWithConfig(t *testing.T, bp string, config android.Config) *android.T
func testCc(t *testing.T, bp string) *android.TestContext {
t.Helper()
config := android.TestArchConfig(buildDir, nil)
config.ProductVariables.DeviceVndkVersion = StringPtr("current")
config.ProductVariables.Platform_vndk_version = StringPtr("VER")
config.TestProductVariables.DeviceVndkVersion = StringPtr("current")
config.TestProductVariables.Platform_vndk_version = StringPtr("VER")
return testCcWithConfig(t, bp, config)
}
@ -197,7 +197,7 @@ func testCc(t *testing.T, bp string) *android.TestContext {
func testCcNoVndk(t *testing.T, bp string) *android.TestContext {
t.Helper()
config := android.TestArchConfig(buildDir, nil)
config.ProductVariables.Platform_vndk_version = StringPtr("VER")
config.TestProductVariables.Platform_vndk_version = StringPtr("VER")
return testCcWithConfig(t, bp, config)
}
@ -205,8 +205,8 @@ func testCcNoVndk(t *testing.T, bp string) *android.TestContext {
func testCcError(t *testing.T, pattern string, bp string) {
t.Helper()
config := android.TestArchConfig(buildDir, nil)
config.ProductVariables.DeviceVndkVersion = StringPtr("current")
config.ProductVariables.Platform_vndk_version = StringPtr("VER")
config.TestProductVariables.DeviceVndkVersion = StringPtr("current")
config.TestProductVariables.Platform_vndk_version = StringPtr("VER")
ctx := createTestContext(t, config, bp)

View file

@ -188,12 +188,12 @@ func TestEnforceRRO(t *testing.T) {
for _, testCase := range testEnforceRROTests {
t.Run(testCase.name, func(t *testing.T) {
config := testConfig(nil)
config.ProductVariables.ResourceOverlays = &resourceOverlays
config.TestProductVariables.ResourceOverlays = &resourceOverlays
if testCase.enforceRROTargets != nil {
config.ProductVariables.EnforceRROTargets = &testCase.enforceRROTargets
config.TestProductVariables.EnforceRROTargets = &testCase.enforceRROTargets
}
if testCase.enforceRROExcludedOverlays != nil {
config.ProductVariables.EnforceRROExcludedOverlays = &testCase.enforceRROExcludedOverlays
config.TestProductVariables.EnforceRROExcludedOverlays = &testCase.enforceRROExcludedOverlays
}
ctx := testAppContext(config, bp, fs)

View file

@ -60,7 +60,7 @@ func testConfig(env map[string]string) android.Config {
env["ANDROID_JAVA8_HOME"] = "jdk8"
}
config := android.TestArchConfig(buildDir, env)
config.ProductVariables.DeviceSystemSdkVersions = &[]string{"14", "15"}
config.TestProductVariables.DeviceSystemSdkVersions = &[]string{"14", "15"}
return config
}