diff options
Diffstat (limited to 'sdk/bootclasspath_fragment_sdk_test.go')
-rw-r--r-- | sdk/bootclasspath_fragment_sdk_test.go | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go index 0ce4351eb..ef4d7cd45 100644 --- a/sdk/bootclasspath_fragment_sdk_test.go +++ b/sdk/bootclasspath_fragment_sdk_test.go @@ -24,6 +24,7 @@ import ( func TestSnapshotWithBootclasspathFragment_ImageName(t *testing.T) { result := android.GroupFixturePreparers( prepareForSdkTestWithJava, + java.PrepareForTestWithJavaDefaultModules, prepareForSdkTestWithApex, // Some additional files needed for the art apex. @@ -32,6 +33,20 @@ func TestSnapshotWithBootclasspathFragment_ImageName(t *testing.T) { "com.android.art.pem": nil, "system/sepolicy/apex/com.android.art-file_contexts": nil, }), + + // platform_bootclasspath that depends on the fragment. + android.FixtureAddTextFile("frameworks/base/boot/Android.bp", ` + platform_bootclasspath { + name: "platform-bootclasspath", + fragments: [ + { + apex: "com.android.art", + module: "mybootclasspathfragment", + }, + ], + } + `), + java.FixtureConfigureBootJars("com.android.art:mybootlib"), android.FixtureWithRootAndroidBp(` sdk { @@ -72,6 +87,23 @@ func TestSnapshotWithBootclasspathFragment_ImageName(t *testing.T) { `), ).RunTest(t) + // A preparer to add a prebuilt apex to the test fixture. + prepareWithPrebuiltApex := android.GroupFixturePreparers( + android.FixtureAddTextFile("prebuilts/apex/Android.bp", ` + prebuilt_apex { + name: "com.android.art", + src: "art.apex", + exported_java_libs: [ + "mybootlib", + ], + exported_bootclasspath_fragments: [ + "mybootclasspathfragment", + ], + } + `), + android.FixtureAddFile("prebuilts/apex/art.apex", nil), + ) + CheckSnapshot(t, result, "mysdk", "", checkUnversionedAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -121,19 +153,9 @@ sdk_snapshot { checkAllCopyRules(` .intermediates/mybootlib/android_common/javac/mybootlib.jar -> java/mybootlib.jar `), - snapshotTestPreparer(checkSnapshotPreferredWithSource, android.GroupFixturePreparers( - android.FixtureAddTextFile("prebuilts/apex/Android.bp", ` - prebuilt_apex { - name: "com.android.art", - src: "art.apex", - exported_java_libs: [ - "mybootlib", - ], - } - `), - android.FixtureAddFile("prebuilts/apex/art.apex", nil), - ), - ), + snapshotTestPreparer(checkSnapshotWithoutSource, prepareWithPrebuiltApex), + snapshotTestPreparer(checkSnapshotWithSourcePreferred, prepareWithPrebuiltApex), + snapshotTestPreparer(checkSnapshotPreferredWithSource, prepareWithPrebuiltApex), ) } |