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        "LatencyTracker_test.cpp",
74        "MultiTouchMotionAccumulator_test.cpp",
75        "NotifyArgs_test.cpp",
76        "PointerChoreographer_test.cpp",
77        "PreferStylusOverTouch_test.cpp",
78        "PropertyProvider_test.cpp",
79        "SlopController_test.cpp",
80        "SyncQueue_test.cpp",
81        "TimerProvider_test.cpp",
82        "TestInputListener.cpp",
83        "TouchpadInputMapper_test.cpp",
84        "MultiTouchInputMapper_test.cpp",
85        "KeyboardInputMapper_test.cpp",
86        "UinputDevice.cpp",
87        "UnwantedInteractionBlocker_test.cpp",
88    ],
89    aidl: {
90        include_dirs: [
91            "frameworks/native/libs/gui",
92            "frameworks/native/libs/input",
93        ],
94    },
95    target: {
96        android: {
97            shared_libs: [
98                "libvintf",
99            ],
100        },
101    },
102    sanitize: {
103        hwaddress: true,
104        undefined: true,
105        all_undefined: true,
106        diag: {
107            undefined: true,
108        },
109    },
110    static_libs: [
111        "libflagtest",
112        "libgmock",
113    ],
114    require_root: true,
115    test_options: {
116        unit_test: true,
117    },
118    test_suites: ["device-tests"],
119}
120