blob: 6af51435c3fc850602abf236c58e0e9544c5e7af [file] [log] [blame]
Lloyd Piquee967d482018-08-31 11:04:49 -07001// Copyright 2018 The Android Open Source Project
Lloyd Piquef58625d2017-12-19 13:22:33 -08002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badour3306e492021-02-25 15:35:37 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_native_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_native_license"],
John Reck38bc8a82024-02-21 17:08:27 -050022 default_team: "trendy_team_android_core_graphics_stack",
Bob Badour3306e492021-02-25 15:35:37 -080023}
24
Lloyd Piquee98286f2024-09-16 16:23:24 -070025// This is a step towards pulling out the "backend" sources to clean up the
26// dependency graph between CompositionEngine and SurfaceFlinger.
27// MockNativeWindow doesn't strictly belong here, but this works for now so
28// that CompositionEngine tests can use these mocks.
Alec Mourie5eb7de2022-01-15 00:34:20 +000029filegroup {
Lloyd Piquee98286f2024-09-16 16:23:24 -070030 name: "libsurfaceflinger_backend_mock_sources",
Alec Mourie5eb7de2022-01-15 00:34:20 +000031 srcs: [
Matt Buckley18b93522024-08-27 05:30:18 +000032 ":poweradvisor_mock_sources",
Alec Mourie5eb7de2022-01-15 00:34:20 +000033 "mock/DisplayHardware/MockComposer.cpp",
34 "mock/DisplayHardware/MockHWC2.cpp",
Lloyd Piquee98286f2024-09-16 16:23:24 -070035 "mock/DisplayHardware/MockHWComposer.cpp",
Lloyd Piquee98286f2024-09-16 16:23:24 -070036 "mock/system/window/MockNativeWindow.cpp",
37 ],
38}
39
40cc_library_headers {
41 name: "libsurfaceflinger_backend_mock_headers",
42 export_include_dirs: ["."],
43 static_libs: [
44 "libgmock",
45 "libgtest",
46 ],
47 export_static_lib_headers: [
48 "libgmock",
49 "libgtest",
50 ],
51}
52
53filegroup {
Matt Buckley18b93522024-08-27 05:30:18 +000054 name: "poweradvisor_mock_sources",
55 srcs: [
56 "mock/PowerAdvisor/*.cpp",
57 ],
58}
59
60filegroup {
Lloyd Piquee98286f2024-09-16 16:23:24 -070061 name: "libsurfaceflinger_mock_sources",
62 srcs: [
Alec Mourie5eb7de2022-01-15 00:34:20 +000063 "mock/MockEventThread.cpp",
64 "mock/MockFrameTimeline.cpp",
65 "mock/MockFrameTracer.cpp",
66 "mock/MockNativeWindowSurface.cpp",
Alec Mourie5eb7de2022-01-15 00:34:20 +000067 "mock/MockTimeStats.cpp",
68 "mock/MockVsyncController.cpp",
Ady Abraham011f8ba2022-11-22 15:09:07 -080069 "mock/MockVSyncDispatch.cpp",
Alec Mourie5eb7de2022-01-15 00:34:20 +000070 "mock/MockVSyncTracker.cpp",
Alec Mourie5eb7de2022-01-15 00:34:20 +000071 ],
72}
73
Ady Abraham529bd9f2023-10-05 14:55:30 -070074cc_aconfig_library {
75 name: "libsurfaceflingerflags_test",
76 aconfig_declarations: "surfaceflinger_flags",
Zi Wang8b7ea532023-11-09 20:14:35 -080077 mode: "test",
Ady Abraham529bd9f2023-10-05 14:55:30 -070078}
79
Lloyd Piquef58625d2017-12-19 13:22:33 -080080cc_test {
81 name: "libsurfaceflinger_unittest",
rnlee756005b2021-05-27 10:46:36 -070082 defaults: [
Vishnu Nair4df8eb62022-02-17 15:32:02 -080083 "libsurfaceflinger_mocks_defaults",
rnlee756005b2021-05-27 10:46:36 -070084 "skia_renderengine_deps",
85 "surfaceflinger_defaults",
86 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -080087 test_suites: ["device-tests"],
Vishnu Nair532d6452024-07-14 22:05:12 -070088 header_libs: ["surfaceflinger_tests_common_headers"],
Lloyd Piquef58625d2017-12-19 13:22:33 -080089 srcs: [
Lloyd Piquee98286f2024-09-16 16:23:24 -070090 ":libsurfaceflinger_backend_mock_sources",
Alec Mourie5eb7de2022-01-15 00:34:20 +000091 ":libsurfaceflinger_mock_sources",
Lloyd Piquef58625d2017-12-19 13:22:33 -080092 ":libsurfaceflinger_sources",
Matt Buckley18b93522024-08-27 05:30:18 +000093 "*.cpp",
Lloyd Piquef58625d2017-12-19 13:22:33 -080094 ],
Vishnu Nair4df8eb62022-02-17 15:32:02 -080095}
96
97cc_defaults {
98 name: "libsurfaceflinger_mocks_defaults",
Sally Qi6920a2f2022-08-26 10:40:05 -070099 defaults: [
100 "android.hardware.graphics.common-ndk_static",
101 "android.hardware.graphics.composer3-ndk_static",
Matt Buckleycc146422023-06-28 19:14:02 +0000102 "android.hardware.power-ndk_static",
Nolan Scobie8ef7e142022-10-14 10:52:43 -0400103 "librenderengine_deps",
Matt Buckleyffc31d12024-02-28 16:51:28 +0000104 "libsurfaceflinger_common_test_deps",
Vishnu Nair6aac09e2024-07-26 21:38:58 +0000105 "libsurfaceflinger_proto_deps",
Sally Qi6920a2f2022-08-26 10:40:05 -0700106 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800107 static_libs: [
Ady Abrahame7385f72021-09-05 00:54:25 -0700108 "android.hardware.common-V2-ndk",
109 "android.hardware.common.fmq-V1-ndk",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800110 "android.hardware.graphics.composer@2.1",
111 "android.hardware.graphics.composer@2.2",
112 "android.hardware.graphics.composer@2.3",
113 "android.hardware.graphics.composer@2.4",
114 "android.hardware.power@1.0",
115 "android.hardware.power@1.1",
116 "android.hardware.power@1.2",
117 "android.hardware.power@1.3",
Ady Abrahame7385f72021-09-05 00:54:25 -0700118 "libaidlcommonsupport",
Lloyd Pique70d91362018-10-18 16:02:55 -0700119 "libcompositionengine_mocks",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800120 "libcompositionengine",
Adithya Srinivasanf279e042020-08-17 14:56:27 -0700121 "libframetimeline",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800122 "libgmock",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700123 "libgui_mocks",
Mikael Pessa2e1608f2019-07-19 11:25:35 -0700124 "libperfetto_client_experimental",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800125 "librenderengine",
Dominik Laskowskif6b4ba62021-11-09 12:46:10 -0800126 "librenderengine_mocks",
127 "libscheduler",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800128 "libserviceutils",
129 "libtimestats",
Tej Singhe2751772021-04-06 22:05:29 -0700130 "libtimestats_atoms_proto",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800131 "libtimestats_proto",
Alec Mouri465b2962021-10-08 16:22:21 -0700132 "libtonemap",
Mikael Pessa2e1608f2019-07-19 11:25:35 -0700133 "perfetto_trace_protos",
134 ],
135 shared_libs: [
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800136 "android.hardware.configstore-utils",
137 "android.hardware.configstore@1.0",
138 "android.hardware.configstore@1.1",
139 "android.hardware.graphics.allocator@2.0",
140 "android.hardware.graphics.allocator@3.0",
141 "android.hardware.graphics.common@1.2",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800142 "libbase",
143 "libbinder",
Ady Abrahame7385f72021-09-05 00:54:25 -0700144 "libbinder_ndk",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800145 "libcutils",
146 "libEGL",
147 "libfmq",
148 "libGLESv1_CM",
149 "libGLESv2",
150 "libgui",
151 "libhidlbase",
152 "libinput",
153 "liblog",
154 "libnativewindow",
Matt Buckley0538cae2022-11-08 23:12:04 +0000155 "libpowermanager",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800156 "libprocessgroup",
157 "libprotobuf-cpp-lite",
Alec Mourid05a7452024-09-20 13:44:02 +0000158 "libstatslog_surfaceflinger",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800159 "libSurfaceFlingerProp",
160 "libsync",
161 "libui",
162 "libutils",
Vishnu Nair47b6e682024-07-12 18:46:07 +0000163 "libtracing_perfetto",
Lloyd Piquef58625d2017-12-19 13:22:33 -0800164 ],
165 header_libs: [
Dominik Laskowski4e0d20d2021-12-06 11:31:02 -0800166 "android.hardware.graphics.composer3-command-buffer",
Vishnu Nairdf6a4f62020-11-11 20:25:34 -0800167 "android.hardware.graphics.composer@2.1-command-buffer",
168 "android.hardware.graphics.composer@2.2-command-buffer",
169 "android.hardware.graphics.composer@2.3-command-buffer",
170 "android.hardware.graphics.composer@2.4-command-buffer",
Dominik Laskowski4e0d20d2021-12-06 11:31:02 -0800171 "libscheduler_test_headers",
Lloyd Piquef58625d2017-12-19 13:22:33 -0800172 "libsurfaceflinger_headers",
173 ],
174}
Vishnu Nair4df8eb62022-02-17 15:32:02 -0800175
176cc_library_headers {
177 name: "libsurfaceflinger_mocks_headers",
178 export_include_dirs: ["."],
179}