xref: /aosp_15_r20/frameworks/native/services/inputflinger/tests/Android.bp (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_input_framework",
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "frameworks_native_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["frameworks_native_license"],
23}
24
25// Source files shared with InputDispatcher's benchmarks and fuzzers
26filegroup {
27    name: "inputdispatcher_common_test_sources",
28    srcs: [
29        "FakeInputDispatcherPolicy.cpp",
30        "FakeWindows.cpp",
31    ],
32}
33
34cc_test {
35    name: "inputflinger_tests",
36    host_supported: true,
37    defaults: [
38        "inputflinger_defaults",
39        // For all targets inside inputflinger, these tests build all of their sources using their
40        // defaults rather than including them as shared or static libraries. By doing so, the tests
41        // will always run against the compiled version of the inputflinger code rather than the
42        // version on the device.
43        "libinputflinger_base_defaults",
44        "libinputreader_defaults",
45        "libinputreporter_defaults",
46        "libinputdispatcher_defaults",
47        "libinputflinger_defaults",
48    ],
49    srcs: [
50        ":inputdispatcher_common_test_sources",
51        "AnrTracker_test.cpp",
52        "CapturedTouchpadEventConverter_test.cpp",
53        "CursorInputMapper_test.cpp",
54        "EventHub_test.cpp",
55        "FakeEventHub.cpp",
56        "FakeInputReaderPolicy.cpp",
57        "FakeInputTracingBackend.cpp",
58        "FakePointerController.cpp",
59        "FocusResolver_test.cpp",
60        "GestureConverter_test.cpp",
61        "HardwareProperties_test.cpp",
62        "HardwareStateConverter_test.cpp",
63        "InputDeviceMetricsCollector_test.cpp",
64        "InputDeviceMetricsSource_test.cpp",
65        "InputMapperTest.cpp",
66        "InputProcessor_test.cpp",
67        "InputProcessorConverter_test.cpp",
68        "InputDispatcher_test.cpp",
69        "InputReader_test.cpp",
70        "InputTraceSession.cpp",
71        "InputTracingTest.cpp",
72        "InstrumentedInputReader.cpp",
73        "JoystickInputMapper_test.cpp",
74        "LatencyTracker_test.cpp",
75        "MultiTouchMotionAccumulator_test.cpp",
76        "NotifyArgs_test.cpp",
77        "PointerChoreographer_test.cpp",
78        "PreferStylusOverTouch_test.cpp",
79        "PropertyProvider_test.cpp",
80        "RotaryEncoderInputMapper_test.cpp",
81        "SensorInputMapper_test.cpp",
82        "SlopController_test.cpp",
83        "SwitchInputMapper_test.cpp",
84        "SyncQueue_test.cpp",
85        "TimerProvider_test.cpp",
86        "TestInputListener.cpp",
87        "TouchpadInputMapper_test.cpp",
88        "VibratorInputMapper_test.cpp",
89        "MultiTouchInputMapper_test.cpp",
90        "KeyboardInputMapper_test.cpp",
91        "UinputDevice.cpp",
92        "UnwantedInteractionBlocker_test.cpp",
93    ],
94    aidl: {
95        include_dirs: [
96            "frameworks/native/libs/gui",
97            "frameworks/native/libs/input",
98        ],
99    },
100    target: {
101        android: {
102            shared_libs: [
103                "libvintf",
104            ],
105        },
106    },
107    sanitize: {
108        hwaddress: true,
109        undefined: true,
110        all_undefined: true,
111        diag: {
112            undefined: true,
113        },
114    },
115    static_libs: [
116        "libflagtest",
117        "libgmock",
118    ],
119    require_root: true,
120    test_options: {
121        unit_test: true,
122    },
123    test_suites: [
124        "device-tests",
125        "device-platinum-tests",
126    ],
127    native_coverage: false,
128}
129