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 "InputConsumer_test.cpp", 20 "InputConsumerFilteredResampling_test.cpp", 21 "InputConsumerResampling_test.cpp", 22 "InputDevice_test.cpp", 23 "InputEvent_test.cpp", 24 "InputPublisherAndConsumer_test.cpp", 25 "InputPublisherAndConsumerNoResampling_test.cpp", 26 "InputVerifier_test.cpp", 27 "MotionPredictor_test.cpp", 28 "MotionPredictorMetricsManager_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 "-Wextra", 57 "-Werror", 58 "-Wno-unused-parameter", 59 ], 60 sanitize: { 61 hwaddress: true, 62 undefined: true, 63 all_undefined: true, 64 diag: { 65 undefined: true, 66 }, 67 }, 68 shared_libs: [ 69 "libbase", 70 "libbinder", 71 "libcutils", 72 "liblog", 73 "libPlatformProperties", 74 "libstatslog", 75 "libtinyxml2", 76 "libutils", 77 "server_configurable_flags", 78 ], 79 data: [ 80 "data/*", 81 ":motion_predictor_model", 82 ], 83 test_options: { 84 unit_test: true, 85 }, 86 test_suites: ["device-tests"], 87 target: { 88 android: { 89 static_libs: [ 90 "libstatslog_libinput", 91 "libstatssocket_lazy", 92 ], 93 }, 94 host: { 95 sanitize: { 96 address: true, 97 }, 98 }, 99 }, 100 native_coverage: false, 101} 102 103// NOTE: This is a compile time test, and does not need to be 104// run. All assertions are static_asserts and will fail during 105// buildtime if something's wrong. 106cc_library_static { 107 name: "StructLayout_test", 108 srcs: ["StructLayout_test.cpp"], 109 compile_multilib: "both", 110 cflags: [ 111 "-Wall", 112 "-Werror", 113 "-Wextra", 114 ], 115 shared_libs: [ 116 "libinput", 117 "libcutils", 118 "libutils", 119 "libbinder", 120 "libbase", 121 ], 122} 123