1// Build the unit tests. 2package { 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 11cc_test { 12 name: "libinput_tests", 13 cpp_std: "c++20", 14 host_supported: true, 15 srcs: [ 16 "BlockingQueue_test.cpp", 17 "IdGenerator_test.cpp", 18 "InputChannel_test.cpp", 19 "InputConsumerFilteredResampling_test.cpp", 20 "InputConsumerResampling_test.cpp", 21 "InputConsumer_test.cpp", 22 "InputDevice_test.cpp", 23 "InputEvent_test.cpp", 24 "InputPublisherAndConsumerNoResampling_test.cpp", 25 "InputPublisherAndConsumer_test.cpp", 26 "InputVerifier_test.cpp", 27 "MotionPredictorMetricsManager_test.cpp", 28 "MotionPredictor_test.cpp", 29 "OneEuroFilter_test.cpp", 30 "Resampler_test.cpp", 31 "RingBuffer_test.cpp", 32 "TestInputChannel.cpp", 33 "TfLiteMotionPredictor_test.cpp", 34 "TouchResampling_test.cpp", 35 "TouchVideoFrame_test.cpp", 36 "VelocityControl_test.cpp", 37 "VelocityTracker_test.cpp", 38 "VerifiedInputEvent_test.cpp", 39 ], 40 header_libs: [ 41 "flatbuffer_headers", 42 "tensorflow_headers", 43 ], 44 static_libs: [ 45 "libflagtest", 46 "libgmock", 47 "libgui_window_info_static", 48 "libinput", 49 "libkernelconfigs", 50 "libtflite_static", 51 "libui-types", 52 "libz", // needed by libkernelconfigs 53 ], 54 cflags: [ 55 "-Wall", 56 "-Werror", 57 "-Wextra", 58 "-Wno-unused-parameter", 59 ], 60 sanitize: { 61 address: true, 62 hwaddress: true, 63 undefined: true, 64 all_undefined: true, 65 diag: { 66 cfi: true, 67 integer_overflow: true, 68 memtag_heap: true, 69 undefined: true, 70 misc_undefined: [ 71 "all", 72 "bounds", 73 ], 74 }, 75 }, 76 shared_libs: [ 77 "libPlatformProperties", 78 "libaconfig_storage_read_api_cc", 79 "libbase", 80 "libbinder", 81 "libcutils", 82 "liblog", 83 "libstatslog", 84 "libtinyxml2", 85 "libutils", 86 "server_configurable_flags", 87 ], 88 data: [ 89 ":motion_predictor_model", 90 "data/*", 91 ], 92 test_options: { 93 unit_test: true, 94 }, 95 test_suites: ["device-tests"], 96 target: { 97 android: { 98 static_libs: [ 99 "libstatslog_libinput", 100 "libstatssocket_lazy", 101 ], 102 }, 103 }, 104 native_coverage: false, 105} 106 107// NOTE: This is a compile time test, and does not need to be 108// run. All assertions are static_asserts and will fail during 109// buildtime if something's wrong. 110cc_library_static { 111 name: "StructLayout_test", 112 srcs: ["StructLayout_test.cpp"], 113 compile_multilib: "both", 114 cflags: [ 115 "-Wall", 116 "-Werror", 117 "-Wextra", 118 ], 119 shared_libs: [ 120 "libbase", 121 "libbinder", 122 "libcutils", 123 "libinput", 124 "libutils", 125 ], 126} 127