blob: f07747f32f3831b436be1940609aedb668742d74 [file] [log] [blame]
Dan Willemsen3106c1c2016-10-03 23:56:51 -07001// 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 Badour3306e492021-02-25 15:35:37 -08005package {
Aditya Choudhary3819e602024-02-05 15:41:13 +00006 default_team: "trendy_team_android_core_graphics_stack",
Bob Badour3306e492021-02-25 15:35:37 -08007 // 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 Shargo550dbaa2024-07-22 22:19:55 +000015aidl_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 Willemsen3106c1c2016-10-03 23:56:51 -070043cc_test {
44 name: "libgui_test",
Dan Shi9cd52062017-03-29 23:09:37 -070045 test_suites: ["device-tests"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070046
Ady Abraham6cdd3fd2023-09-07 18:45:58 -070047 defaults: ["libgui-defaults"],
48
49 cppflags: [
Chih-Hung Hsiehd66be0a2017-10-05 13:51:32 -070050 "-Wall",
51 "-Werror",
Siarhei Vishniakoubf98a572024-03-29 13:34:42 -070052 "-Wextra",
53 "-Wthread-safety",
Ady Abraham107788e2023-10-17 12:31:08 -070054 "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_SETFRAMERATE=true",
John Reckdb164ff2024-04-03 16:59:28 -040055 "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_EXTENDEDALLOCATE=true",
Jim Shargod30823a2024-07-27 02:49:39 +000056 "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_CONSUMER_BASE_OWNS_BQ=true",
Jim Shargo00886392024-07-12 22:12:20 +000057 "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_PLATFORM_API_IMPROVEMENTS=true",
Chih-Hung Hsiehd66be0a2017-10-05 13:51:32 -070058 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070059
60 srcs: [
Valerie Hauc5011f92019-10-11 09:52:07 -070061 "BLASTBufferQueue_test.cpp",
Yahan Zhou3cbda592020-08-03 15:53:27 -070062 "BufferItemConsumer_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070063 "BufferQueue_test.cpp",
Patrick Williamsf693bcf2024-08-02 09:55:23 -050064 "BufferReleaseChannel_test.cpp",
Chavi Weingarten475c4132024-02-29 15:56:15 +000065 "Choreographer_test.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -070066 "CompositorTiming_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070067 "CpuConsumer_test.cpp",
Kevin DuBois9c0a1762018-10-16 13:32:31 -070068 "DisplayedContentSampling_test.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000069 "DisplayInfo_test.cpp",
70 "EndToEndNativeInputTest.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070071 "FillBuffer.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000072 "FrameRateUtilsTest.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070073 "GLTest.cpp",
74 "IGraphicBufferProducer_test.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000075 "LibGuiMain.cpp", // Custom gtest entrypoint
Dan Stoza47730d62017-05-16 15:12:48 -070076 "Malicious.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070077 "MultiTextureConsumer_test.cpp",
Kevin DuBois4df38a42019-02-14 12:59:43 -080078 "RegionSampling_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070079 "StreamSplitter_test.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000080 "Surface_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070081 "SurfaceTextureClient_test.cpp",
82 "SurfaceTextureFBO_test.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000083 "SurfaceTextureGL_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070084 "SurfaceTextureGLThreadToGL_test.cpp",
85 "SurfaceTextureGLToGL_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070086 "SurfaceTextureMultiContextGL_test.cpp",
Jim Shargo550dbaa2024-07-22 22:19:55 +000087 "TestServer_test.cpp",
88 "testserver/TestServer.cpp",
89 "testserver/TestServerClient.cpp",
90 "testserver/TestServerHost.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070091 "TextureRenderer.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -080092 "VsyncEventData_test.cpp",
chaviw98318de2021-05-19 16:45:23 -050093 "WindowInfo_test.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070094 ],
95
96 shared_libs: [
Courtney Goeltzenleuchter6a570b62017-03-13 14:30:00 -060097 "android.hardware.configstore@1.0",
98 "android.hardware.configstore-utils",
Sundong Ahne6e7d442020-04-23 21:31:20 +090099 "libSurfaceFlingerProp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700100 "libGLESv1_CM",
Jim Shargo550dbaa2024-07-22 22:19:55 +0000101 "libgui_test_server_aidl-cpp",
Robert Carr3720ed02018-08-08 16:08:27 -0700102 "libinput",
Chavi Weingarten475c4132024-02-29 15:56:15 +0000103 "libnativedisplay",
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700104 ],
105
Jim Shargo550dbaa2024-07-22 22:19:55 +0000106 // 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 Abraham6cdd3fd2023-09-07 18:45:58 -0700112 static_libs: [
113 "libgmock",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700114 ],
Sundong Ahne6e7d442020-04-23 21:31:20 +0900115
116 header_libs: ["libsurfaceflinger_headers"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700117}
Jiwen 'Steve' Caic90a77f2018-01-14 15:42:29 -0800118
Yahan Zhou3cbda592020-08-03 15:53:27 -0700119// Build the tests that need to run with both 32bit and 64bit.
120cc_test {
121 name: "libgui_multilib_test",
122 test_suites: ["device-tests"],
123
Yahan Zhou3cbda592020-08-03 15:53:27 -0700124 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"],
jahinimtiaz63138ec2023-03-14 00:07:50 +0000140 data: [
141 ":libgui_test",
142 ],
Yahan Zhou3cbda592020-08-03 15:53:27 -0700143}
144
Dan Stozaec460082018-12-17 15:35:09 -0800145cc_test {
146 name: "SamplingDemo",
147
Dan Stozaec460082018-12-17 15:35:09 -0800148 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 Pradhan48f8cb92021-08-26 14:05:36 -0700164 ],
Dan Stozaec460082018-12-17 15:35:09 -0800165}