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:
@@ -15,6 +15,7 @@
|
|||||||
package java
|
package java
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -96,20 +97,24 @@ func TestAndroidAppSet_Variants(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range testCases {
|
for _, test := range testCases {
|
||||||
config := testAppConfig(nil, bp, nil)
|
ctx := android.GroupFixturePreparers(
|
||||||
config.TestProductVariables.AAPTPrebuiltDPI = test.aaptPrebuiltDPI
|
PrepareForTestWithJavaDefaultModules,
|
||||||
config.TestProductVariables.Platform_sdk_version = &test.sdkVersion
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
config.Targets[android.Android] = test.targets
|
variables.AAPTPrebuiltDPI = test.aaptPrebuiltDPI
|
||||||
ctx := testContext(config)
|
variables.Platform_sdk_version = &test.sdkVersion
|
||||||
run(t, ctx, config)
|
}),
|
||||||
|
android.FixtureModifyConfig(func(config android.Config) {
|
||||||
|
config.Targets[android.Android] = test.targets
|
||||||
|
}),
|
||||||
|
).RunTestWithBp(t, bp)
|
||||||
|
|
||||||
module := ctx.ModuleForTests("foo", "android_common")
|
module := ctx.ModuleForTests("foo", "android_common")
|
||||||
const packedSplitApks = "foo.zip"
|
const packedSplitApks = "foo.zip"
|
||||||
params := module.Output(packedSplitApks)
|
params := module.Output(packedSplitApks)
|
||||||
for k, v := range test.expected {
|
for k, v := range test.expected {
|
||||||
if actual := params.Args[k]; actual != v {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
t.Errorf("%s: bad build arg value for '%s': '%s', expected '%s'",
|
android.AssertStringEquals(t, fmt.Sprintf("arg value for `%s`", k), v, params.Args[k])
|
||||||
test.name, k, actual, v)
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user