Merge "Revert "bootclasspath_fragment: Treat some specific modules as test""
This commit is contained in:
@@ -840,22 +840,7 @@ func (b *BootclasspathFragmentModule) createHiddenAPIFlagInput(ctx android.Modul
|
|||||||
|
|
||||||
// isTestFragment returns true if the current module is a test bootclasspath_fragment.
|
// isTestFragment returns true if the current module is a test bootclasspath_fragment.
|
||||||
func (b *BootclasspathFragmentModule) isTestFragment() bool {
|
func (b *BootclasspathFragmentModule) isTestFragment() bool {
|
||||||
if b.testFragment {
|
return b.testFragment
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(b/194063708): Once test fragments all use bootclasspath_fragment_test
|
|
||||||
// Some temporary exceptions until all test fragments use the
|
|
||||||
// bootclasspath_fragment_test module type.
|
|
||||||
name := b.BaseModuleName()
|
|
||||||
if strings.HasPrefix(name, "test_") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if name == "apex.apexd_test_bootclasspath-fragment" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// produceHiddenAPIOutput produces the hidden API all-flags.csv file (and supporting files)
|
// produceHiddenAPIOutput produces the hidden API all-flags.csv file (and supporting files)
|
||||||
|
@@ -408,22 +408,6 @@ func TestBootclasspathFragment_Test(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
bootclasspath_fragment {
|
|
||||||
name: "test_fragment",
|
|
||||||
contents: ["mysdklibrary"],
|
|
||||||
hidden_api: {
|
|
||||||
split_packages: [],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
bootclasspath_fragment {
|
|
||||||
name: "apex.apexd_test_bootclasspath-fragment",
|
|
||||||
contents: ["mysdklibrary"],
|
|
||||||
hidden_api: {
|
|
||||||
split_packages: [],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
bootclasspath_fragment_test {
|
bootclasspath_fragment_test {
|
||||||
name: "a_test_fragment",
|
name: "a_test_fragment",
|
||||||
contents: ["mysdklibrary"],
|
contents: ["mysdklibrary"],
|
||||||
@@ -445,12 +429,6 @@ func TestBootclasspathFragment_Test(t *testing.T) {
|
|||||||
fragment := result.Module("myfragment", "android_common").(*BootclasspathFragmentModule)
|
fragment := result.Module("myfragment", "android_common").(*BootclasspathFragmentModule)
|
||||||
android.AssertBoolEquals(t, "not a test fragment", false, fragment.isTestFragment())
|
android.AssertBoolEquals(t, "not a test fragment", false, fragment.isTestFragment())
|
||||||
|
|
||||||
fragment = result.Module("test_fragment", "android_common").(*BootclasspathFragmentModule)
|
|
||||||
android.AssertBoolEquals(t, "is a test fragment by prefix", true, fragment.isTestFragment())
|
|
||||||
|
|
||||||
fragment = result.Module("a_test_fragment", "android_common").(*BootclasspathFragmentModule)
|
fragment = result.Module("a_test_fragment", "android_common").(*BootclasspathFragmentModule)
|
||||||
android.AssertBoolEquals(t, "is a test fragment by type", true, fragment.isTestFragment())
|
android.AssertBoolEquals(t, "is a test fragment by type", true, fragment.isTestFragment())
|
||||||
|
|
||||||
fragment = result.Module("apex.apexd_test_bootclasspath-fragment", "android_common").(*BootclasspathFragmentModule)
|
|
||||||
android.AssertBoolEquals(t, "is a test fragment by name", true, fragment.isTestFragment())
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user