Add "contents" property to systemserverclasspath_fragment.

Similar to bcp_fragment's contents, this property lists all java library
contributions made by this fragment.

Bug: 180105615
Test: m nothing
Change-Id: Ifb1f54d5db290fffaa31933d15207014bb72d2fb
This commit is contained in:
satayev
2021-05-17 21:13:44 +01:00
parent 14e49130bb
commit 9366a053da
2 changed files with 52 additions and 7 deletions

View File

@@ -20,13 +20,13 @@ import (
"android/soong/android"
)
var prepareForTestWithSystemserverClasspath = android.GroupFixturePreparers(
var prepareForTestWithSystemServerClasspath = android.GroupFixturePreparers(
PrepareForTestWithJavaDefaultModules,
)
func TestSystemserverClasspathVariant(t *testing.T) {
func TestPlatformSystemserverClasspathVariant(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForTestWithSystemserverClasspath,
prepareForTestWithSystemServerClasspath,
android.FixtureWithRootAndroidBp(`
platform_systemserverclasspath {
name: "platform-systemserverclasspath",
@@ -38,9 +38,9 @@ func TestSystemserverClasspathVariant(t *testing.T) {
android.AssertIntEquals(t, "expect 1 variant", 1, len(variants))
}
func TestSystemserverClasspath_ClasspathFragmentPaths(t *testing.T) {
func TestPlatformSystemserverClasspath_ClasspathFragmentPaths(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForTestWithSystemserverClasspath,
prepareForTestWithSystemServerClasspath,
android.FixtureWithRootAndroidBp(`
platform_systemserverclasspath {
name: "platform-systemserverclasspath",
@@ -53,9 +53,9 @@ func TestSystemserverClasspath_ClasspathFragmentPaths(t *testing.T) {
android.AssertPathRelativeToTopEquals(t, "install filepath", "out/soong/target/product/test_device/system/etc/classpaths", p.ClasspathFragmentBase.installDirPath)
}
func TestSystemserverClasspathModule_AndroidMkEntries(t *testing.T) {
func TestPlatformSystemserverClasspathModule_AndroidMkEntries(t *testing.T) {
preparer := android.GroupFixturePreparers(
prepareForTestWithSystemserverClasspath,
prepareForTestWithSystemServerClasspath,
android.FixtureWithRootAndroidBp(`
platform_systemserverclasspath {
name: "platform-systemserverclasspath",
@@ -95,3 +95,14 @@ func TestSystemserverClasspathModule_AndroidMkEntries(t *testing.T) {
}
})
}
func TestSystemserverclasspathFragmentWithoutContents(t *testing.T) {
prepareForTestWithSystemServerClasspath.
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(
`\Qempty contents are not allowed\E`)).
RunTestWithBp(t, `
systemserverclasspath_fragment {
name: "systemserverclasspath-fragment",
}
`)
}