blob: 138898fc1f0c6d0d07d5930be3178fd9c17e1642 [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: [
Garfield Tan84b087e2020-01-23 10:49:05 -080016 "IdGenerator_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070017 "InputChannel_test.cpp",
Siarhei Vishniakou257553c2019-02-21 14:37:06 -060018 "InputDevice_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070019 "InputEvent_test.cpp",
20 "InputPublisherAndConsumer_test.cpp",
Prabir Pradhan3117a442023-08-11 17:48:43 +000021 "InputVerifier_test.cpp",
Siarhei Vishniakou39147ce2022-11-15 12:13:04 -080022 "MotionPredictor_test.cpp",
Cody Heiner52db4742023-06-29 13:19:01 -070023 "MotionPredictorMetricsManager_test.cpp",
Philip Quinn9b8926e2023-01-31 14:50:02 -080024 "RingBuffer_test.cpp",
Philip Quinn8f953ab2022-12-06 15:37:07 -080025 "TfLiteMotionPredictor_test.cpp",
Siarhei Vishniakou0ced3cc2017-11-21 15:33:17 -080026 "TouchResampling_test.cpp",
Siarhei Vishniakou5ac663d2019-02-15 17:15:56 -060027 "TouchVideoFrame_test.cpp",
Siarhei Vishniakoud4b607e2017-06-13 12:21:59 +010028 "VelocityTracker_test.cpp",
Siarhei Vishniakou54d3e182020-01-15 17:38:38 -080029 "VerifiedInputEvent_test.cpp",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070030 ],
Philip Quinn8f953ab2022-12-06 15:37:07 -080031 header_libs: [
32 "flatbuffer_headers",
33 "tensorflow_headers",
34 ],
chaviw98318de2021-05-19 16:45:23 -050035 static_libs: [
Philip Quinn8f953ab2022-12-06 15:37:07 -080036 "libgmock",
chaviw98318de2021-05-19 16:45:23 -050037 "libgui_window_info_static",
38 "libinput",
Philip Quinnda6a4482023-02-07 10:09:57 -080039 "libtflite_static",
Siarhei Vishniakou5e83dfe2022-09-28 17:04:42 -070040 "libui-types",
chaviw98318de2021-05-19 16:45:23 -050041 ],
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070042 cflags: [
43 "-Wall",
Siarhei Vishniakou635cb712017-11-01 16:32:14 -070044 "-Wextra",
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070045 "-Werror",
Philip Quinn8f953ab2022-12-06 15:37:07 -080046 "-Wno-unused-parameter",
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -070047 ],
Siarhei Vishniakou659a6242023-02-28 15:13:04 -080048 sanitize: {
Siarhei Vishniakoub15f2642023-05-12 20:15:25 +000049 hwaddress: true,
Siarhei Vishniakou659a6242023-02-28 15:13:04 -080050 undefined: true,
51 all_undefined: true,
52 diag: {
53 undefined: true,
54 },
55 },
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050056 shared_libs: [
Siarhei Vishniakoud4b607e2017-06-13 12:21:59 +010057 "libbase",
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050058 "libbinder",
59 "libcutils",
60 "liblog",
Siarhei Vishniakou39147ce2022-11-15 12:13:04 -080061 "libPlatformProperties",
Philip Quinnf84fa492023-06-26 14:15:15 -070062 "libtinyxml2",
Siarhei Vishniakoue9cadca2020-09-14 18:24:51 -050063 "libutils",
Siarhei Vishniakoua9fd82c2022-05-18 09:42:52 -070064 "libvintf",
Siarhei Vishniakou96818962023-08-23 10:19:02 -070065 "server_configurable_flags",
Siarhei Vishniakoua8388392020-10-21 23:58:48 -050066 ],
Philip Quinn8f953ab2022-12-06 15:37:07 -080067 data: [
68 "data/*",
Philip Quinnf84fa492023-06-26 14:15:15 -070069 ":motion_predictor_model",
Philip Quinn8f953ab2022-12-06 15:37:07 -080070 ],
Siarhei Vishniakou5e83dfe2022-09-28 17:04:42 -070071 test_options: {
72 unit_test: true,
73 },
Siarhei Vishniakoua8388392020-10-21 23:58:48 -050074 test_suites: ["device-tests"],
Cody Heiner52db4742023-06-29 13:19:01 -070075 target: {
76 host: {
77 sanitize: {
78 address: true,
79 },
80 },
81 android: {
82 static_libs: [
83 // Stats logging library and its dependencies.
84 "libstatslog_libinput",
85 "libstatsbootstrap",
86 "android.os.statsbootstrap_aidl-cpp",
87 ],
88 },
89 },
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070090}
91
92// NOTE: This is a compile time test, and does not need to be
93// run. All assertions are static_asserts and will fail during
94// buildtime if something's wrong.
95cc_library_static {
96 name: "StructLayout_test",
97 srcs: ["StructLayout_test.cpp"],
Siarhei Vishniakoudbdb6732021-04-26 19:40:26 +000098 compile_multilib: "both",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -070099 cflags: [
Chih-Hung Hsieh687a0d12017-10-05 15:20:11 -0700100 "-Wall",
101 "-Werror",
Siarhei Vishniakou257553c2019-02-21 14:37:06 -0600102 "-Wextra",
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700103 ],
Robert Carr3720ed02018-08-08 16:08:27 -0700104 shared_libs: [
105 "libinput",
106 "libcutils",
107 "libutils",
108 "libbinder",
Robert Carr3720ed02018-08-08 16:08:27 -0700109 "libbase",
Philip Junker90bc9492021-12-10 18:39:42 +0100110 ],
Dan Willemsenc7dd2b92016-08-25 17:05:22 -0700111}