Merge "Convert testDexpreoptBoot to use test fixtures" am: a8c443618a
am: 34fc4cf2fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629622 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I5f6eb23663c51bf0024d03c8ce739647cd778113
This commit is contained in:
@@ -16,7 +16,6 @@ package java
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -44,17 +43,11 @@ func testDexpreoptBoot(t *testing.T, ruleFile string, expectedInputs, expectedOu
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
config := testConfig(nil, bp, nil)
|
result := javaFixtureFactory.
|
||||||
|
Extend(dexpreopt.FixtureSetBootJars("platform:foo", "platform:bar", "platform:baz")).
|
||||||
|
RunTestWithBp(t, bp)
|
||||||
|
|
||||||
pathCtx := android.PathContextForTesting(config)
|
dexpreoptBootJars := result.SingletonForTests("dex_bootjars")
|
||||||
dexpreoptConfig := dexpreopt.GlobalConfigForTests(pathCtx)
|
|
||||||
dexpreoptConfig.BootJars = android.CreateTestConfiguredJarList([]string{"platform:foo", "platform:bar", "platform:baz"})
|
|
||||||
dexpreopt.SetTestGlobalConfig(config, dexpreoptConfig)
|
|
||||||
|
|
||||||
ctx := testContext(config)
|
|
||||||
run(t, ctx, config)
|
|
||||||
|
|
||||||
dexpreoptBootJars := ctx.SingletonForTests("dex_bootjars")
|
|
||||||
rule := dexpreoptBootJars.Output(ruleFile)
|
rule := dexpreoptBootJars.Output(ruleFile)
|
||||||
|
|
||||||
for i := range expectedInputs {
|
for i := range expectedInputs {
|
||||||
@@ -73,13 +66,9 @@ func testDexpreoptBoot(t *testing.T, ruleFile string, expectedInputs, expectedOu
|
|||||||
sort.Strings(outputs)
|
sort.Strings(outputs)
|
||||||
sort.Strings(expectedOutputs)
|
sort.Strings(expectedOutputs)
|
||||||
|
|
||||||
if !reflect.DeepEqual(inputs, expectedInputs) {
|
result.AssertDeepEquals("inputs", expectedInputs, inputs)
|
||||||
t.Errorf("want inputs %q\n got inputs %q", expectedInputs, inputs)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !reflect.DeepEqual(outputs, expectedOutputs) {
|
result.AssertDeepEquals("outputs", expectedOutputs, outputs)
|
||||||
t.Errorf("want outputs %q\n got outputs %q", expectedOutputs, outputs)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDexpreoptBootJars(t *testing.T) {
|
func TestDexpreoptBootJars(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user