summaryrefslogtreecommitdiff
path: root/libs/input/tests/Android.bp
blob: 968fa5fc1ab1b9b75ecfbc24943f8a43ee991a17 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Build the unit tests.
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_native_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_native_license"],
}

cc_test {
    name: "libinput_tests",
    cpp_std: "c++20",
    host_supported: true,
    srcs: [
        "BlockingQueue_test.cpp",
        "IdGenerator_test.cpp",
        "InputChannel_test.cpp",
        "InputConsumerFilteredResampling_test.cpp",
        "InputConsumerResampling_test.cpp",
        "InputConsumer_test.cpp",
        "InputDevice_test.cpp",
        "InputEvent_test.cpp",
        "InputPublisherAndConsumerNoResampling_test.cpp",
        "InputPublisherAndConsumer_test.cpp",
        "InputVerifier_test.cpp",
        "MotionPredictorMetricsManager_test.cpp",
        "MotionPredictor_test.cpp",
        "OneEuroFilter_test.cpp",
        "Resampler_test.cpp",
        "RingBuffer_test.cpp",
        "TestInputChannel.cpp",
        "TfLiteMotionPredictor_test.cpp",
        "TouchResampling_test.cpp",
        "TouchVideoFrame_test.cpp",
        "VelocityControl_test.cpp",
        "VelocityTracker_test.cpp",
        "VerifiedInputEvent_test.cpp",
    ],
    header_libs: [
        "flatbuffer_headers",
        "tensorflow_headers",
    ],
    static_libs: [
        "libflagtest",
        "libgmock",
        "libgui_window_info_static",
        "libinput",
        "libkernelconfigs",
        "libtflite_static",
        "libui-types",
        "libz", // needed by libkernelconfigs
    ],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wextra",
        "-Wno-unused-parameter",
    ],
    sanitize: {
        address: true,
        hwaddress: true,
        undefined: true,
        all_undefined: true,
        diag: {
            cfi: true,
            integer_overflow: true,
            memtag_heap: true,
            undefined: true,
            misc_undefined: [
                "all",
                "bounds",
            ],
        },
    },
    shared_libs: [
        "libPlatformProperties",
        "libaconfig_storage_read_api_cc",
        "libbase",
        "libbinder",
        "libcutils",
        "liblog",
        "libstatslog",
        "libtinyxml2",
        "libutils",
        "server_configurable_flags",
    ],
    data: [
        ":motion_predictor_model",
        "data/*",
    ],
    test_options: {
        unit_test: true,
    },
    test_suites: ["device-tests"],
    target: {
        android: {
            static_libs: [
                "libstatslog_libinput",
                "libstatssocket_lazy",
            ],
        },
    },
    native_coverage: false,
}

// NOTE: This is a compile time test, and does not need to be
// run. All assertions are static_asserts and will fail during
// buildtime if something's wrong.
cc_library_static {
    name: "StructLayout_test",
    srcs: ["StructLayout_test.cpp"],
    compile_multilib: "both",
    cflags: [
        "-Wall",
        "-Werror",
        "-Wextra",
    ],
    shared_libs: [
        "libbase",
        "libbinder",
        "libcutils",
        "libinput",
        "libutils",
    ],
}