blob: 46e819061fdb64884f7195738d32452c06366a6d [file] [log] [blame]
Dan Willemsenc7dd2b92016-08-25 17:05:22 -07001// Build the unit tests.
Bob Badour3306e492021-02-25 15:35:37 -08002package {
3 // See: http://go/android-license-faq
4 // A large-scale-change added 'default_applicable_licenses' to import
5 // all of the 'license_kinds' from "frameworks_native_license"
6 // to get the below license kinds:
7 // SPDX-license-identifier-Apache-2.0
8 default_applicable_licenses: ["frameworks_native_license"],
9}
10
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070011cc_test {
12 name: "libinput_tests",
Philip Quinn8f953ab2022-12-06 15:37:07 -080013 cpp_std: "c++20",
Siarhei Vishniakou5e83dfe2022-09-28 17:04:42 -070014 host_supported: true,
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070015 srcs: [
Siarhei Vishniakou3782af62024-03-07 21:56:39 -080016 "BlockingQueue_test.cpp",
Garfield Tan84b087e2020-01-23 10:49:05 -080017 "IdGenerator_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070018 "InputChannel_test.cpp",
Paul Ramireze2bb1872024-08-12 20:21:13 +000019 "InputConsumer_test.cpp",
Paul Ramirez5d59a422024-10-01 15:59:16 +000020 "InputConsumerResampling_test.cpp",
Siarhei Vishniakou257553c2019-02-21 14:37:06 -060021 "InputDevice_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070022 "InputEvent_test.cpp",
23 "InputPublisherAndConsumer_test.cpp",
Siarhei Vishniakou2b920272024-02-27 19:49:51 -080024 "InputPublisherAndConsumerNoResampling_test.cpp",
Prabir Pradhan3117a442023-08-11 17:48:43 +000025 "InputVerifier_test.cpp",
Siarhei Vishniakou39147ce2022-11-15 12:13:04 -080026 "MotionPredictor_test.cpp",
Cody Heiner52db4742023-06-29 13:19:01 -070027 "MotionPredictorMetricsManager_test.cpp",
Paul Ramirez08ee1992024-10-10 18:02:15 +000028 "OneEuroFilter_test.cpp",
Paul Ramirezbe9c5442024-07-10 00:12:41 +000029 "Resampler_test.cpp",
Philip Quinn9b8926e2023-01-31 14:50:02 -080030 "RingBuffer_test.cpp",
Paul Ramireze2bb1872024-08-12 20:21:13 +000031 "TestInputChannel.cpp",
Philip Quinn8f953ab2022-12-06 15:37:07 -080032 "TfLiteMotionPredictor_test.cpp",
Siarhei Vishniakou0ced3cc2017-11-21 15:33:17 -080033 "TouchResampling_test.cpp",
Siarhei Vishniakou5ac663d2019-02-15 17:15:56 -060034 "TouchVideoFrame_test.cpp",
Harry Cuttse78184b2024-01-08 15:54:58 +000035 "VelocityControl_test.cpp",
Siarhei Vishniakoud4b607e2017-06-13 12:21:59 +010036 "VelocityTracker_test.cpp",
Siarhei Vishniakou54d3e182020-01-15 17:38:38 -080037 "VerifiedInputEvent_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070038 ],
Philip Quinn8f953ab2022-12-06 15:37:07 -080039 header_libs: [
40 "flatbuffer_headers",
41 "tensorflow_headers",
42 ],
chaviw98318de2021-05-19 16:45:23 -050043 static_libs: [
Derek Wuaaa47312024-03-26 15:53:44 -070044 "libflagtest",
Philip Quinn8f953ab2022-12-06 15:37:07 -080045 "libgmock",
chaviw98318de2021-05-19 16:45:23 -050046 "libgui_window_info_static",
47 "libinput",
Jooyung Han3f669212023-12-05 14:18:19 +090048 "libkernelconfigs",
Philip Quinnda6a4482023-02-07 10:09:57 -080049 "libtflite_static",
Siarhei Vishniakou5e83dfe2022-09-28 17:04:42 -070050 "libui-types",
Jooyung Han3f669212023-12-05 14:18:19 +090051 "libz", // needed by libkernelconfigs
chaviw98318de2021-05-19 16:45:23 -050052 ],
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070053 cflags: [
54 "-Wall",
Siarhei Vishniakou635cb712017-11-01 16:32:14 -070055 "-Wextra",
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070056 "-Werror",
Philip Quinn8f953ab2022-12-06 15:37:07 -080057 "-Wno-unused-parameter",
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070058 ],
Siarhei Vishniakou659a6242023-02-28 15:13:04 -080059 sanitize: {
Siarhei Vishniakoub15f2642023-05-12 20:15:25 +000060 hwaddress: true,
Siarhei Vishniakou659a6242023-02-28 15:13:04 -080061 undefined: true,
62 all_undefined: true,
63 diag: {
64 undefined: true,
65 },
66 },
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050067 shared_libs: [
Siarhei Vishniakoud4b607e2017-06-13 12:21:59 +010068 "libbase",
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050069 "libbinder",
70 "libcutils",
71 "liblog",
Siarhei Vishniakou39147ce2022-11-15 12:13:04 -080072 "libPlatformProperties",
Cody Heinere17cb302024-04-17 01:26:37 +000073 "libstatslog",
Philip Quinnf84fa492023-06-26 14:15:15 -070074 "libtinyxml2",
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050075 "libutils",
Siarhei Vishniakou96818962023-08-23 10:19:02 -070076 "server_configurable_flags",
Siarhei Vishniakoua8388392020-10-21 23:58:48 -050077 ],
Philip Quinn8f953ab2022-12-06 15:37:07 -080078 data: [
79 "data/*",
Philip Quinnf84fa492023-06-26 14:15:15 -070080 ":motion_predictor_model",
Philip Quinn8f953ab2022-12-06 15:37:07 -080081 ],
Siarhei Vishniakou5e83dfe2022-09-28 17:04:42 -070082 test_options: {
83 unit_test: true,
84 },
Siarhei Vishniakoua8388392020-10-21 23:58:48 -050085 test_suites: ["device-tests"],
Cody Heiner52db4742023-06-29 13:19:01 -070086 target: {
Cody Heinerb0b5b6c2024-05-09 18:31:12 -070087 android: {
88 static_libs: [
89 "libstatslog_libinput",
90 "libstatssocket_lazy",
91 ],
92 },
Cody Heiner52db4742023-06-29 13:19:01 -070093 host: {
94 sanitize: {
95 address: true,
96 },
97 },
Cody Heiner52db4742023-06-29 13:19:01 -070098 },
Yifeng Zengdf9edb32024-09-16 18:16:07 +000099 native_coverage: false,
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700100}
101
102// NOTE: This is a compile time test, and does not need to be
103// run. All assertions are static_asserts and will fail during
104// buildtime if something's wrong.
105cc_library_static {
106 name: "StructLayout_test",
107 srcs: ["StructLayout_test.cpp"],
Siarhei Vishniakoudbdb6732021-04-26 19:40:26 +0000108 compile_multilib: "both",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700109 cflags: [
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -0700110 "-Wall",
111 "-Werror",
Siarhei Vishniakou257553c2019-02-21 14:37:06 -0600112 "-Wextra",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700113 ],
Robert Carr3720ed02018-08-08 16:08:27 -0700114 shared_libs: [
115 "libinput",
116 "libcutils",
117 "libutils",
118 "libbinder",
Robert Carr3720ed02018-08-08 16:08:27 -0700119 "libbase",
Philip Junker90bc9492021-12-10 18:39:42 +0100120 ],
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700121}