diff options
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index 387533c1f..c502968d7 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -1902,6 +1902,51 @@ func TestApexUsesFailsIfUseNoApex(t *testing.T) { } +func TestErrorsIfDepsAreNotEnabled(t *testing.T) { + testApexError(t, `module "myapex" .* depends on disabled module "libfoo"`, ` + apex { + name: "myapex", + key: "myapex.key", + native_shared_libs: ["libfoo"], + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + cc_library { + name: "libfoo", + stl: "none", + system_shared_libs: [], + enabled: false, + } + `) + testApexError(t, `module "myapex" .* depends on disabled module "myjar"`, ` + apex { + name: "myapex", + key: "myapex.key", + java_libs: ["myjar"], + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + java_library { + name: "myjar", + srcs: ["foo/bar/MyClass.java"], + sdk_version: "none", + system_modules: "none", + compile_dex: true, + enabled: false, + } + `) +} + func TestMain(m *testing.M) { run := func() int { setUp() |