Allow sdk package tests to optimize their test setup am: cf3ee2f87e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645676

Change-Id: I16d55dbb80f577dd1f3b7a513eb5c12ae8a8dea6
This commit is contained in:
Paul Duffin 2021-03-22 23:01:30 +00:00 committed by Automerger Merge Worker
commit 33972970ea
1 changed files with 20 additions and 6 deletions

View File

@ -27,13 +27,9 @@ import (
"android/soong/java"
)
var prepareForSdkTest = android.GroupFixturePreparers(
// Prepare for running an sdk test with an apex.
var prepareForSdkTestWithApex = android.GroupFixturePreparers(
apex.PrepareForTestWithApexBuildComponents,
cc.PrepareForTestWithCcDefaultModules,
genrule.PrepareForTestWithGenRuleBuildComponents,
java.PrepareForTestWithJavaBuildComponents,
PrepareForTestWithSdkBuildComponents,
android.FixtureAddTextFile("sdk/tests/Android.bp", `
apex_key {
name: "myapex.key",
@ -58,6 +54,24 @@ var prepareForSdkTest = android.GroupFixturePreparers(
"myapex.x509.pem": nil,
"myapex.pk8": nil,
}),
)
// Legacy preparer used for running tests within the sdk package.
//
// This includes everything that was needed to run any test in the sdk package prior to the
// introduction of the test fixtures. Tests that are being converted to use fixtures directly
// rather than through the testSdkError() and testSdkWithFs() methods should avoid using this and
// instead should use the various preparers directly using android.GroupFixturePreparers(...) to
// group them when necessary.
//
// deprecated
var prepareForSdkTest = android.GroupFixturePreparers(
cc.PrepareForTestWithCcDefaultModules,
genrule.PrepareForTestWithGenRuleBuildComponents,
java.PrepareForTestWithJavaBuildComponents,
PrepareForTestWithSdkBuildComponents,
prepareForSdkTestWithApex,
cc.PrepareForTestOnWindows,
android.FixtureModifyConfig(func(config android.Config) {