add the LOCAL_DISABLE_TEST_CONFIG variable

Introduce and set the variable LOCAL_DISABLE_TEST_CONFIG varaible to be
true for the `android_test_helper_app` type modules.

Bug: 188927912
Test: rum 'm module-name' (`android_test_helper_app` type module)
Test: TreeHugger
Change-Id: I5db1029f31d8afe1ca5e9fab95e39d751971058d
This commit is contained in:
Yuntao Xu
2021-05-27 10:30:26 -07:00
parent d8561166eb
commit 7a31855228
2 changed files with 20 additions and 0 deletions

View File

@@ -188,3 +188,21 @@ func TestImportSoongDexJar(t *testing.T) {
android.AssertStringPathsRelativeToTopEquals(t, "LOCAL_SOONG_DEX_JAR", result.Config, []string{expectedSoongDexJar}, actualSoongDexJar)
}
func TestAndroidTestHelperApp_LocalDisableTestConfig(t *testing.T) {
ctx, _ := testJava(t, `
android_test_helper_app {
name: "foo",
srcs: ["a.java"],
}
`)
mod := ctx.ModuleForTests("foo", "android_common").Module()
entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0]
expected := []string{"true"}
actual := entries.EntryMap["LOCAL_DISABLE_TEST_CONFIG"]
if !reflect.DeepEqual(expected, actual) {
t.Errorf("Unexpected flag value - expected: %q, actual: %q", expected, actual)
}
}