xref: /aosp_15_r20/frameworks/native/services/surfaceflinger/tests/unittests/Android.bp (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1// Copyright 2018 The Android Open Source Project
2//
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
15package {
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"],
22    default_team: "trendy_team_android_core_graphics_stack",
23}
24
25// 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.
29filegroup {
30    name: "libsurfaceflinger_backend_mock_sources",
31    srcs: [
32        ":poweradvisor_mock_sources",
33        "mock/DisplayHardware/MockComposer.cpp",
34        "mock/DisplayHardware/MockHWC2.cpp",
35        "mock/DisplayHardware/MockHWComposer.cpp",
36        "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 {
54    name: "poweradvisor_mock_sources",
55    srcs: [
56        "mock/PowerAdvisor/*.cpp",
57    ],
58}
59
60filegroup {
61    name: "libsurfaceflinger_mock_sources",
62    srcs: [
63        "mock/MockEventThread.cpp",
64        "mock/MockFrameTimeline.cpp",
65        "mock/MockFrameTracer.cpp",
66        "mock/MockNativeWindowSurface.cpp",
67        "mock/MockTimeStats.cpp",
68        "mock/MockVsyncController.cpp",
69        "mock/MockVSyncDispatch.cpp",
70        "mock/MockVSyncTracker.cpp",
71    ],
72}
73
74cc_aconfig_library {
75    name: "libsurfaceflingerflags_test",
76    aconfig_declarations: "surfaceflinger_flags",
77    mode: "test",
78}
79
80cc_test {
81    name: "libsurfaceflinger_unittest",
82    defaults: [
83        "libsurfaceflinger_mocks_defaults",
84        "skia_renderengine_deps",
85        "surfaceflinger_defaults",
86    ],
87    test_suites: ["device-tests"],
88    header_libs: ["surfaceflinger_tests_common_headers"],
89    srcs: [
90        ":libsurfaceflinger_backend_mock_sources",
91        ":libsurfaceflinger_mock_sources",
92        ":libsurfaceflinger_sources",
93        "*.cpp",
94    ],
95}
96
97cc_defaults {
98    name: "libsurfaceflinger_mocks_defaults",
99    defaults: [
100        "android.hardware.graphics.common-ndk_static",
101        "android.hardware.graphics.composer3-ndk_static",
102        "android.hardware.power-ndk_static",
103        "librenderengine_deps",
104        "libsurfaceflinger_common_test_deps",
105        "libsurfaceflinger_proto_deps",
106    ],
107    static_libs: [
108        "android.hardware.common-V2-ndk",
109        "android.hardware.common.fmq-V1-ndk",
110        "[email protected]",
111        "[email protected]",
112        "[email protected]",
113        "[email protected]",
114        "[email protected]",
115        "[email protected]",
116        "[email protected]",
117        "[email protected]",
118        "libaidlcommonsupport",
119        "libcompositionengine_mocks",
120        "libcompositionengine",
121        "libframetimeline",
122        "libgmock",
123        "libgui_mocks",
124        "libperfetto_client_experimental",
125        "librenderengine",
126        "librenderengine_mocks",
127        "libscheduler",
128        "libserviceutils",
129        "libtimestats",
130        "libtimestats_atoms_proto",
131        "libtimestats_proto",
132        "libtonemap",
133        "perfetto_trace_protos",
134    ],
135    shared_libs: [
136        "android.hardware.configstore-utils",
137        "[email protected]",
138        "[email protected]",
139        "[email protected]",
140        "[email protected]",
141        "[email protected]",
142        "libbase",
143        "libbinder",
144        "libbinder_ndk",
145        "libcutils",
146        "libEGL",
147        "libfmq",
148        "libGLESv1_CM",
149        "libGLESv2",
150        "libgui",
151        "libhidlbase",
152        "libinput",
153        "liblog",
154        "libnativewindow",
155        "libpowermanager",
156        "libprocessgroup",
157        "libprotobuf-cpp-lite",
158        "libstatslog_surfaceflinger",
159        "libSurfaceFlingerProp",
160        "libsync",
161        "libui",
162        "libutils",
163        "libtracing_perfetto",
164    ],
165    header_libs: [
166        "android.hardware.graphics.composer3-command-buffer",
167        "[email protected]",
168        "[email protected]",
169        "[email protected]",
170        "[email protected]",
171        "libscheduler_test_headers",
172        "libsurfaceflinger_headers",
173    ],
174}
175
176cc_library_headers {
177    name: "libsurfaceflinger_mocks_headers",
178    export_include_dirs: ["."],
179}
180