SdkTestCore for non-updatable modules

Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
This commit is contained in:
Mark White
2023-08-10 00:07:03 +00:00
parent 4189ebdbd5
commit beb6e9ffdb
4 changed files with 45 additions and 4 deletions

View File

@@ -1416,6 +1416,32 @@ func TestJavaSdkLibrary_StubOnlyLibs_PassedToDroidstubs(t *testing.T) {
android.AssertStringListContains(t, "foo stubs should depend on bar-lib", fooStubsSources.Javadoc.properties.Libs, "bar-lib")
}
func TestJavaSdkLibrary_Scope_Libs_PassedToDroidstubs(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForJavaTest,
PrepareForTestWithJavaSdkLibraryFiles,
FixtureWithLastReleaseApis("foo"),
).RunTestWithBp(t, `
java_sdk_library {
name: "foo",
srcs: ["a.java"],
public: {
enabled: true,
libs: ["bar-lib"],
},
}
java_library {
name: "bar-lib",
srcs: ["b.java"],
}
`)
// The foo.stubs.source should depend on bar-lib
fooStubsSources := result.ModuleForTests("foo.stubs.source", "android_common").Module().(*Droidstubs)
android.AssertStringListContains(t, "foo stubs should depend on bar-lib", fooStubsSources.Javadoc.properties.Libs, "bar-lib")
}
func TestJavaSdkLibrary_ApiLibrary(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForJavaTest,