diff options
| author | satayev <satayev@google.com> | 2021-08-06 13:20:28 +0100 |
|---|---|---|
| committer | satayev <satayev@google.com> | 2021-08-16 12:00:25 +0100 |
| commit | d34eb0c4a6e176ca129f66f0449bd0ba19fdff5e (patch) | |
| tree | d9ec7ce082ff942f98acacbbe2797c7cfacc7914 /apex/systemserver_classpath_fragment_test.go | |
| parent | fc30cfc7ae35ac92d2e7b423b23c1bba8fa3f005 (diff) | |
Make sure that classpath fragment contents appear in make vars.
The source of truth for what jars are in BOOTCLASSPATH and
SYSTEMSERVERCLASSPATH is make; adding a classpath fragment in soong
with a new jar in the contents without having it declared in make
is wrong (excluding test apexes).
Bug: 191369843
Test: m nothing
Change-Id: Ifd313776ee7ad206031244534ed3870126e4f835
Diffstat (limited to 'apex/systemserver_classpath_fragment_test.go')
| -rw-r--r-- | apex/systemserver_classpath_fragment_test.go | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/apex/systemserver_classpath_fragment_test.go b/apex/systemserver_classpath_fragment_test.go index a64c6f4a2..a8d5931db 100644 --- a/apex/systemserver_classpath_fragment_test.go +++ b/apex/systemserver_classpath_fragment_test.go @@ -130,3 +130,54 @@ func TestSystemserverclasspathFragmentNoGeneratedProto(t *testing.T) { `mysystemserverclasspathfragment`, }) } + +func TestSystemServerClasspathFragmentWithContentNotInMake(t *testing.T) { + android.GroupFixturePreparers( + prepareForTestWithSystemserverclasspathFragment, + prepareForTestWithMyapex, + dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"), + ). + ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern( + `in contents must also be declared in PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS`)). + RunTestWithBp(t, ` + apex { + name: "myapex", + key: "myapex.key", + systemserverclasspath_fragments: [ + "mysystemserverclasspathfragment", + ], + updatable: false, + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + java_library { + name: "foo", + srcs: ["b.java"], + installable: true, + apex_available: ["myapex"], + } + + java_library { + name: "bar", + srcs: ["b.java"], + installable: true, + apex_available: ["myapex"], + } + + systemserverclasspath_fragment { + name: "mysystemserverclasspathfragment", + contents: [ + "foo", + "bar", + ], + apex_available: [ + "myapex", + ], + } + `) +} |
