Add test to ensure test data written for flat apex

Bug: 155820504
Test: apex_test
Change-Id: Id0db24ad139962523532e16934bd95bed06073a8
This commit is contained in:
Liz Kammer 2020-05-20 09:57:08 -07:00
parent 4cb7fc05ae
commit 81faaaf65b
1 changed files with 9 additions and 3 deletions

View File

@ -3331,9 +3331,9 @@ func TestApexWithTests(t *testing.T) {
ensureContains(t, copyCmds, "image.apex/bin/test/mytest3") ensureContains(t, copyCmds, "image.apex/bin/test/mytest3")
// Ensure the module is correctly translated. // Ensure the module is correctly translated.
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle) bundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
data := android.AndroidMkDataForTest(t, config, "", apexBundle) data := android.AndroidMkDataForTest(t, config, "", bundle)
name := apexBundle.BaseModuleName() name := bundle.BaseModuleName()
prefix := "TARGET_" prefix := "TARGET_"
var builder strings.Builder var builder strings.Builder
data.Custom(&builder, name, prefix, "", data) data.Custom(&builder, name, prefix, "", data)
@ -3345,6 +3345,12 @@ func TestApexWithTests(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex\n") ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := apex_pubkey.myapex\n") ensureContains(t, androidMk, "LOCAL_MODULE := apex_pubkey.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := myapex\n") ensureContains(t, androidMk, "LOCAL_MODULE := myapex\n")
flatBundle := ctx.ModuleForTests("myapex", "android_common_myapex_flattened").Module().(*apexBundle)
data = android.AndroidMkDataForTest(t, config, "", flatBundle)
data.Custom(&builder, name, prefix, "", data)
flatAndroidMk := builder.String()
ensureContains(t, flatAndroidMk, "LOCAL_TEST_DATA := :baz :bar/baz\n")
} }
func TestInstallExtraFlattenedApexes(t *testing.T) { func TestInstallExtraFlattenedApexes(t *testing.T) {