summaryrefslogtreecommitdiff
path: root/services/tests/wmtests/Android.bp
blob: 2ce7cea08a3dddbc7e5dd5c49efa789ad439934f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//########################################################################
// Build WmTests package
//########################################################################

package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

// Include all test java files.
filegroup {
    name: "wmtests-sources",
    srcs: [
        "src/**/*.java",
    ],
}

genrule {
    name: "wmtests.protologsrc",
    srcs: [
        ":protolog-groups",
        ":wmtests-sources",
    ],
    tools: ["protologtool"],
    cmd: "$(location protologtool) transform-protolog-calls " +
      "--protolog-class com.android.internal.protolog.common.ProtoLog " +
      "--protolog-impl-class com.android.internal.protolog.ProtoLogImpl " +
      "--protolog-cache-class 'com.android.server.wm.ProtoLogCache' " +
      "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
      "--loggroups-jar $(location :protolog-groups) " +
      "--output-srcjar $(out) " +
      "$(locations :wmtests-sources)",
    out: ["wmtests.protolog.srcjar"],
}

android_test {
    name: "WmTests",

    // We only want this apk build for tests.
    srcs: [":wmtests.protologsrc"],

    static_libs: [
        "frameworks-base-testutils",
        "services.core",
        "androidx.test.runner",
        "androidx.test.rules",
        "mockito-target-extended-minus-junit4",
        "platform-test-annotations",
        "servicestests-utils",
        "testng",
        "truth-prebuilt",
        "testables",
        "ub-uiautomator",
        "hamcrest-library",
        "platform-compat-test-rules",
        "CtsSurfaceValidatorLib",
        "service-sdksandbox.impl",
    ],

    libs: [
        "android.hardware.power-V1-java",
        "android.test.mock",
        "android.test.base",
        "android.test.runner",
    ],

    defaults: [
        "modules-utils-testable-device-config-defaults",
    ],

    // These are not normally accessible from apps so they must be explicitly included.
    jni_libs: [
        "libdexmakerjvmtiagent",
        "libstaticjvmtiagent",
    ],

    platform_apis: true,
    test_suites: ["device-tests"],

    certificate: "platform",

    dxflags: ["--multi-dex"],

    optimize: {
        enabled: false,
    },

}