summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2020-10-26 09:57:40 +0000
committerAnton Hansson <hansson@google.com>2020-10-26 11:38:40 +0000
commit52ac73d21ec9c75f76efb921c7454c233b94ee00 (patch)
treecb66f4d1f417e93f70daf6773662ae9b1b6f07cb /java/java_test.go
parent1e8118da95fca42e911469168d9f2fc082a05691 (diff)
Make highmem classification of metalava optional
We have added a lot of metalava invocations since the highmem differentation was added, most of which do not use a lot of memory. By collecting data of max rss per process we have narrowed down the set of highmem modules to a smaller set, and will annotate the relevant modules as such. Bug: 170701554 Test: NINJA_HIGHMEM_NUM_JOBS=3 m checkapi (no long tail of metalava) Change-Id: Ic9c8c91388b02889111ef596fc6fd8bde9b42b9d
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go41
1 files changed, 21 insertions, 20 deletions
diff --git a/java/java_test.go b/java/java_test.go
index c751ea4e7..cdb437538 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1232,31 +1232,24 @@ func TestDroiddocArgsAndFlagsCausesError(t *testing.T) {
func TestDroidstubs(t *testing.T) {
ctx, _ := testJavaWithFS(t, `
droiddoc_exported_dir {
- name: "droiddoc-templates-sdk",
- path: ".",
+ name: "droiddoc-templates-sdk",
+ path: ".",
}
droidstubs {
- name: "bar-stubs",
- srcs: [
- "bar-doc/a.java",
- ],
- api_levels_annotations_dirs: [
- "droiddoc-templates-sdk",
- ],
- api_levels_annotations_enabled: true,
+ name: "bar-stubs",
+ srcs: ["bar-doc/a.java"],
+ api_levels_annotations_dirs: ["droiddoc-templates-sdk"],
+ api_levels_annotations_enabled: true,
}
droidstubs {
- name: "bar-stubs-other",
- srcs: [
- "bar-doc/a.java",
- ],
- api_levels_annotations_dirs: [
- "droiddoc-templates-sdk",
- ],
- api_levels_annotations_enabled: true,
- api_levels_jar_filename: "android.other.jar",
+ name: "bar-stubs-other",
+ srcs: ["bar-doc/a.java"],
+ high_mem: true,
+ api_levels_annotations_dirs: ["droiddoc-templates-sdk"],
+ api_levels_annotations_enabled: true,
+ api_levels_jar_filename: "android.other.jar",
}
`,
map[string][]byte{
@@ -1265,23 +1258,31 @@ func TestDroidstubs(t *testing.T) {
testcases := []struct {
moduleName string
expectedJarFilename string
+ high_mem bool
}{
{
moduleName: "bar-stubs",
expectedJarFilename: "android.jar",
+ high_mem: false,
},
{
moduleName: "bar-stubs-other",
expectedJarFilename: "android.other.jar",
+ high_mem: true,
},
}
for _, c := range testcases {
m := ctx.ModuleForTests(c.moduleName, "android_common")
metalava := m.Rule("metalava")
+ rp := metalava.RuleParams
expected := "--android-jar-pattern ./%/public/" + c.expectedJarFilename
- if actual := metalava.RuleParams.Command; !strings.Contains(actual, expected) {
+ if actual := rp.Command; !strings.Contains(actual, expected) {
t.Errorf("For %q, expected metalava argument %q, but was not found %q", c.moduleName, expected, actual)
}
+
+ if actual := rp.Pool != nil && strings.Contains(rp.Pool.String(), "highmem"); actual != c.high_mem {
+ t.Errorf("Expected %q high_mem to be %v, was %v", c.moduleName, c.high_mem, actual)
+ }
}
}