Merge "Remove uses of buildDir from java/app_set_test.go" am: 86da0448c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649799 Change-Id: Iabb1d2fb39eb6246e17c9d29e6b6e11fca6bbee1
This commit is contained in:
commit
84e6aaa26c
|
@ -15,6 +15,7 @@
|
|||
package java
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
|
@ -96,20 +97,24 @@ func TestAndroidAppSet_Variants(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
config := testAppConfig(nil, bp, nil)
|
||||
config.TestProductVariables.AAPTPrebuiltDPI = test.aaptPrebuiltDPI
|
||||
config.TestProductVariables.Platform_sdk_version = &test.sdkVersion
|
||||
config.Targets[android.Android] = test.targets
|
||||
ctx := testContext(config)
|
||||
run(t, ctx, config)
|
||||
ctx := android.GroupFixturePreparers(
|
||||
PrepareForTestWithJavaDefaultModules,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.AAPTPrebuiltDPI = test.aaptPrebuiltDPI
|
||||
variables.Platform_sdk_version = &test.sdkVersion
|
||||
}),
|
||||
android.FixtureModifyConfig(func(config android.Config) {
|
||||
config.Targets[android.Android] = test.targets
|
||||
}),
|
||||
).RunTestWithBp(t, bp)
|
||||
|
||||
module := ctx.ModuleForTests("foo", "android_common")
|
||||
const packedSplitApks = "foo.zip"
|
||||
params := module.Output(packedSplitApks)
|
||||
for k, v := range test.expected {
|
||||
if actual := params.Args[k]; actual != v {
|
||||
t.Errorf("%s: bad build arg value for '%s': '%s', expected '%s'",
|
||||
test.name, k, actual, v)
|
||||
}
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
android.AssertStringEquals(t, fmt.Sprintf("arg value for `%s`", k), v, params.Args[k])
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue