Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 1 | // Build the unit tests, |
| 2 | |
| 3 | // Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE) |
| 4 | // to integrate with auto-test framework. |
Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 5 | package { |
Aditya Choudhary | 3819e60 | 2024-02-05 15:41:13 +0000 | [diff] [blame] | 6 | default_team: "trendy_team_android_core_graphics_stack", |
Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 7 | // See: http://go/android-license-faq |
| 8 | // A large-scale-change added 'default_applicable_licenses' to import |
| 9 | // all of the 'license_kinds' from "frameworks_native_license" |
| 10 | // to get the below license kinds: |
| 11 | // SPDX-license-identifier-Apache-2.0 |
| 12 | default_applicable_licenses: ["frameworks_native_license"], |
| 13 | } |
| 14 | |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 15 | aidl_interface { |
| 16 | name: "libgui_test_server_aidl", |
| 17 | unstable: true, |
| 18 | srcs: ["testserver/aidl/**/*.aidl"], |
| 19 | local_include_dir: "testserver/aidl", |
| 20 | include_dirs: [ |
| 21 | "frameworks/native/aidl/gui", |
| 22 | ], |
| 23 | backend: { |
| 24 | cpp: { |
| 25 | enabled: true, |
| 26 | additional_shared_libraries: [ |
| 27 | "libgui", |
| 28 | "libui", |
| 29 | ], |
| 30 | }, |
| 31 | java: { |
| 32 | enabled: false, |
| 33 | }, |
| 34 | ndk: { |
| 35 | enabled: false, |
| 36 | }, |
| 37 | rust: { |
| 38 | enabled: false, |
| 39 | }, |
| 40 | }, |
| 41 | } |
| 42 | |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 43 | cc_test { |
| 44 | name: "libgui_test", |
Dan Shi | 9cd5206 | 2017-03-29 23:09:37 -0700 | [diff] [blame] | 45 | test_suites: ["device-tests"], |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 46 | |
Ady Abraham | 6cdd3fd | 2023-09-07 18:45:58 -0700 | [diff] [blame] | 47 | defaults: ["libgui-defaults"], |
| 48 | |
| 49 | cppflags: [ |
Chih-Hung Hsieh | d66be0a | 2017-10-05 13:51:32 -0700 | [diff] [blame] | 50 | "-Wall", |
| 51 | "-Werror", |
Siarhei Vishniakou | bf98a57 | 2024-03-29 13:34:42 -0700 | [diff] [blame] | 52 | "-Wextra", |
| 53 | "-Wthread-safety", |
Ady Abraham | 107788e | 2023-10-17 12:31:08 -0700 | [diff] [blame] | 54 | "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_SETFRAMERATE=true", |
John Reck | db164ff | 2024-04-03 16:59:28 -0400 | [diff] [blame] | 55 | "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_EXTENDEDALLOCATE=true", |
Jim Shargo | d30823a | 2024-07-27 02:49:39 +0000 | [diff] [blame] | 56 | "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_CONSUMER_BASE_OWNS_BQ=true", |
Jim Shargo | 0088639 | 2024-07-12 22:12:20 +0000 | [diff] [blame] | 57 | "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_PLATFORM_API_IMPROVEMENTS=true", |
Chih-Hung Hsieh | d66be0a | 2017-10-05 13:51:32 -0700 | [diff] [blame] | 58 | ], |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 59 | |
| 60 | srcs: [ |
Valerie Hau | c5011f9 | 2019-10-11 09:52:07 -0700 | [diff] [blame] | 61 | "BLASTBufferQueue_test.cpp", |
Yahan Zhou | 3cbda59 | 2020-08-03 15:53:27 -0700 | [diff] [blame] | 62 | "BufferItemConsumer_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 63 | "BufferQueue_test.cpp", |
Patrick Williams | f693bcf | 2024-08-02 09:55:23 -0500 | [diff] [blame] | 64 | "BufferReleaseChannel_test.cpp", |
Chavi Weingarten | 475c413 | 2024-02-29 15:56:15 +0000 | [diff] [blame] | 65 | "Choreographer_test.cpp", |
Dominik Laskowski | 5a5e01e | 2022-07-08 07:52:44 -0700 | [diff] [blame] | 66 | "CompositorTiming_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 67 | "CpuConsumer_test.cpp", |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 68 | "DisplayedContentSampling_test.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 69 | "DisplayInfo_test.cpp", |
| 70 | "EndToEndNativeInputTest.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 71 | "FillBuffer.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 72 | "FrameRateUtilsTest.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 73 | "GLTest.cpp", |
| 74 | "IGraphicBufferProducer_test.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 75 | "LibGuiMain.cpp", // Custom gtest entrypoint |
Dan Stoza | 47730d6 | 2017-05-16 15:12:48 -0700 | [diff] [blame] | 76 | "Malicious.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 77 | "MultiTextureConsumer_test.cpp", |
Kevin DuBois | 4df38a4 | 2019-02-14 12:59:43 -0800 | [diff] [blame] | 78 | "RegionSampling_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 79 | "StreamSplitter_test.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 80 | "Surface_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 81 | "SurfaceTextureClient_test.cpp", |
| 82 | "SurfaceTextureFBO_test.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 83 | "SurfaceTextureGL_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 84 | "SurfaceTextureGLThreadToGL_test.cpp", |
| 85 | "SurfaceTextureGLToGL_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 86 | "SurfaceTextureMultiContextGL_test.cpp", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 87 | "TestServer_test.cpp", |
| 88 | "testserver/TestServer.cpp", |
| 89 | "testserver/TestServerClient.cpp", |
| 90 | "testserver/TestServerHost.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 91 | "TextureRenderer.cpp", |
Rachel Lee | 18c3437 | 2022-01-20 13:57:18 -0800 | [diff] [blame] | 92 | "VsyncEventData_test.cpp", |
chaviw | 98318de | 2021-05-19 16:45:23 -0500 | [diff] [blame] | 93 | "WindowInfo_test.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 94 | ], |
| 95 | |
| 96 | shared_libs: [ |
Courtney Goeltzenleuchter | 6a570b6 | 2017-03-13 14:30:00 -0600 | [diff] [blame] | 97 | "android.hardware.configstore@1.0", |
| 98 | "android.hardware.configstore-utils", |
Sundong Ahn | e6e7d44 | 2020-04-23 21:31:20 +0900 | [diff] [blame] | 99 | "libSurfaceFlingerProp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 100 | "libGLESv1_CM", |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 101 | "libgui_test_server_aidl-cpp", |
Robert Carr | 3720ed0 | 2018-08-08 16:08:27 -0700 | [diff] [blame] | 102 | "libinput", |
Chavi Weingarten | 475c413 | 2024-02-29 15:56:15 +0000 | [diff] [blame] | 103 | "libnativedisplay", |
Ady Abraham | 6cdd3fd | 2023-09-07 18:45:58 -0700 | [diff] [blame] | 104 | ], |
| 105 | |
Jim Shargo | 550dbaa | 2024-07-22 22:19:55 +0000 | [diff] [blame] | 106 | // This needs to get copied over for the test since it's not part of the |
| 107 | // platform. |
| 108 | data_libs: [ |
| 109 | "libgui_test_server_aidl-cpp", |
| 110 | ], |
| 111 | |
Ady Abraham | 6cdd3fd | 2023-09-07 18:45:58 -0700 | [diff] [blame] | 112 | static_libs: [ |
| 113 | "libgmock", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 114 | ], |
Sundong Ahn | e6e7d44 | 2020-04-23 21:31:20 +0900 | [diff] [blame] | 115 | |
| 116 | header_libs: ["libsurfaceflinger_headers"], |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 117 | } |
Jiwen 'Steve' Cai | c90a77f | 2018-01-14 15:42:29 -0800 | [diff] [blame] | 118 | |
Yahan Zhou | 3cbda59 | 2020-08-03 15:53:27 -0700 | [diff] [blame] | 119 | // Build the tests that need to run with both 32bit and 64bit. |
| 120 | cc_test { |
| 121 | name: "libgui_multilib_test", |
| 122 | test_suites: ["device-tests"], |
| 123 | |
Yahan Zhou | 3cbda59 | 2020-08-03 15:53:27 -0700 | [diff] [blame] | 124 | cflags: [ |
| 125 | "-Wall", |
| 126 | "-Werror", |
| 127 | ], |
| 128 | |
| 129 | srcs: [ |
| 130 | "DisplayEventStructLayout_test.cpp", |
| 131 | ], |
| 132 | |
| 133 | shared_libs: [ |
| 134 | "libgui", |
| 135 | ], |
| 136 | |
| 137 | compile_multilib: "both", |
| 138 | |
| 139 | header_libs: ["libsurfaceflinger_headers"], |
jahinimtiaz | 63138ec | 2023-03-14 00:07:50 +0000 | [diff] [blame] | 140 | data: [ |
| 141 | ":libgui_test", |
| 142 | ], |
Yahan Zhou | 3cbda59 | 2020-08-03 15:53:27 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Dan Stoza | ec46008 | 2018-12-17 15:35:09 -0800 | [diff] [blame] | 145 | cc_test { |
| 146 | name: "SamplingDemo", |
| 147 | |
Dan Stoza | ec46008 | 2018-12-17 15:35:09 -0800 | [diff] [blame] | 148 | cflags: [ |
| 149 | "-Wall", |
| 150 | "-Werror", |
| 151 | ], |
| 152 | |
| 153 | srcs: [ |
| 154 | "SamplingDemo.cpp", |
| 155 | ], |
| 156 | |
| 157 | shared_libs: [ |
| 158 | "libbinder", |
| 159 | "libcutils", |
| 160 | "libgui", |
| 161 | "liblog", |
| 162 | "libui", |
| 163 | "libutils", |
Prabir Pradhan | 48f8cb9 | 2021-08-26 14:05:36 -0700 | [diff] [blame] | 164 | ], |
Dan Stoza | ec46008 | 2018-12-17 15:35:09 -0800 | [diff] [blame] | 165 | } |