summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-03-18 01:19:26 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-03-18 01:19:26 +0000
commitd21a743f73c6b76a76f2764bcdf448bd4544a216 (patch)
tree8c3ab769e81d6e4882e61f395d40227d3d39674a /apex/apex_test.go
parentfde59126604d75e9660d69dac8940b617ebfb5a4 (diff)
parent9918e1afd7ee027dde86c43ca4e14f4399dc758a (diff)
Merge "track static deps when gatherint notices for apex"
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index babc27b43..5468c77bf 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -168,6 +168,7 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
"vendor/foo/devkeys/testkey.pem": nil,
"NOTICE": nil,
"custom_notice": nil,
+ "custom_notice_for_static_lib": nil,
"testkey2.avbpubkey": nil,
"testkey2.pem": nil,
"myapex-arm64.apex": nil,
@@ -372,6 +373,20 @@ func TestBasicApex(t *testing.T) {
system_shared_libs: [],
stl: "none",
notice: "custom_notice",
+ static_libs: ["libstatic"],
+ // TODO: remove //apex_available:platform
+ apex_available: [
+ "//apex_available:platform",
+ "myapex",
+ ],
+ }
+
+ cc_library_static {
+ name: "libstatic",
+ srcs: ["mylib.cpp"],
+ system_shared_libs: [],
+ stl: "none",
+ notice: "custom_notice_for_static_lib",
// TODO: remove //apex_available:platform
apex_available: [
"//apex_available:platform",
@@ -470,11 +485,12 @@ func TestBasicApex(t *testing.T) {
mergeNoticesRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("mergeNoticesRule")
noticeInputs := mergeNoticesRule.Inputs.Strings()
- if len(noticeInputs) != 2 {
- t.Errorf("number of input notice files: expected = 2, actual = %q", len(noticeInputs))
+ if len(noticeInputs) != 3 {
+ t.Errorf("number of input notice files: expected = 3, actual = %q", len(noticeInputs))
}
ensureListContains(t, noticeInputs, "NOTICE")
ensureListContains(t, noticeInputs, "custom_notice")
+ ensureListContains(t, noticeInputs, "custom_notice_for_static_lib")
depsInfo := strings.Split(ctx.ModuleForTests("myapex", "android_common_myapex_image").Output("myapex-deps-info.txt").Args["content"], "\\n")
ensureListContains(t, depsInfo, "myjar <- myapex")