diff options
author | 2021-07-20 09:47:41 -0700 | |
---|---|---|
committer | 2021-07-20 12:46:48 -0700 | |
commit | 0c66bc615b399d2201b15b4c9052066db04a3f5e (patch) | |
tree | be8334e4662f4bf137d2231dc92755e44fc85d5e /java/sdk_test.go | |
parent | ae86338676084cf5966adf99f34e7086f9687edc (diff) |
Replace android.BuildOs with Config.BuildOS
Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.
Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
Diffstat (limited to 'java/sdk_test.go')
-rw-r--r-- | java/sdk_test.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/java/sdk_test.go b/java/sdk_test.go index bb595a54e..6d6213011 100644 --- a/java/sdk_test.go +++ b/java/sdk_test.go @@ -255,9 +255,11 @@ func TestClasspath(t *testing.T) { ` + testcase.properties + ` }` - variant := "android_common" - if testcase.host == android.Host { - variant = android.BuildOs.String() + "_common" + variant := func(result *android.TestResult) string { + if testcase.host == android.Host { + return result.Config.BuildOS.String() + "_common" + } + return "android_common" } convertModulesToPaths := func(cp []string) []string { @@ -312,7 +314,7 @@ func TestClasspath(t *testing.T) { } checkClasspath := func(t *testing.T, result *android.TestResult, isJava8 bool) { - foo := result.ModuleForTests("foo", variant) + foo := result.ModuleForTests("foo", variant(result)) javac := foo.Rule("javac") var deps []string @@ -376,7 +378,7 @@ func TestClasspath(t *testing.T) { checkClasspath(t, result, true /* isJava8 */) if testcase.host != android.Host { - aidl := result.ModuleForTests("foo", variant).Rule("aidl") + aidl := result.ModuleForTests("foo", variant(result)).Rule("aidl") android.AssertStringDoesContain(t, "aidl command", aidl.RuleParams.Command, testcase.aidl+" -I.") } @@ -389,7 +391,7 @@ func TestClasspath(t *testing.T) { checkClasspath(t, result, false /* isJava8 */) if testcase.host != android.Host { - aidl := result.ModuleForTests("foo", variant).Rule("aidl") + aidl := result.ModuleForTests("foo", variant(result)).Rule("aidl") android.AssertStringDoesContain(t, "aidl command", aidl.RuleParams.Command, testcase.aidl+" -I.") } |