Loading java/androidmk.go +2 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,8 @@ func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries { entries := &entriesList[0] entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites) // introduce a flag variable to control the generation of the .config file entries.SetString("LOCAL_DISABLE_TEST_CONFIG", "true") }) return entriesList Loading java/androidmk_test.go +18 −0 Original line number Diff line number Diff line Loading @@ -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) } } Loading
java/androidmk.go +2 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,8 @@ func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries { entries := &entriesList[0] entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites) // introduce a flag variable to control the generation of the .config file entries.SetString("LOCAL_DISABLE_TEST_CONFIG", "true") }) return entriesList Loading
java/androidmk_test.go +18 −0 Original line number Diff line number Diff line Loading @@ -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) } }