Lloyd Pique | e967d48 | 2018-08-31 11:04:49 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Android Open Source Project |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 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 | |
Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 15 | package { |
| 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 | } |
| 23 | |
Alec Mouri | e5eb7de | 2022-01-15 00:34:20 +0000 | [diff] [blame] | 24 | filegroup { |
| 25 | name: "libsurfaceflinger_mock_sources", |
| 26 | srcs: [ |
| 27 | "mock/DisplayHardware/MockComposer.cpp", |
| 28 | "mock/DisplayHardware/MockHWC2.cpp", |
Xiang Wang | e12b4fa | 2022-03-25 23:48:40 +0000 | [diff] [blame^] | 29 | "mock/DisplayHardware/MockIPower.cpp", |
| 30 | "mock/DisplayHardware/MockIPowerHintSession.cpp", |
Alec Mouri | e5eb7de | 2022-01-15 00:34:20 +0000 | [diff] [blame] | 31 | "mock/DisplayHardware/MockPowerAdvisor.cpp", |
| 32 | "mock/MockEventThread.cpp", |
| 33 | "mock/MockFrameTimeline.cpp", |
| 34 | "mock/MockFrameTracer.cpp", |
| 35 | "mock/MockNativeWindowSurface.cpp", |
| 36 | "mock/MockSurfaceInterceptor.cpp", |
| 37 | "mock/MockTimeStats.cpp", |
| 38 | "mock/MockVsyncController.cpp", |
| 39 | "mock/MockVSyncTracker.cpp", |
| 40 | "mock/system/window/MockNativeWindow.cpp", |
| 41 | ], |
| 42 | } |
| 43 | |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 44 | cc_test { |
| 45 | name: "libsurfaceflinger_unittest", |
rnlee | 756005b | 2021-05-27 10:46:36 -0700 | [diff] [blame] | 46 | defaults: [ |
Vishnu Nair | 4df8eb6 | 2022-02-17 15:32:02 -0800 | [diff] [blame] | 47 | "libsurfaceflinger_mocks_defaults", |
rnlee | 756005b | 2021-05-27 10:46:36 -0700 | [diff] [blame] | 48 | "skia_renderengine_deps", |
| 49 | "surfaceflinger_defaults", |
| 50 | ], |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 51 | test_suites: ["device-tests"], |
Lloyd Pique | e967d48 | 2018-08-31 11:04:49 -0700 | [diff] [blame] | 52 | sanitize: { |
| 53 | // Using the address sanitizer not only helps uncover issues in the code |
| 54 | // covered by the tests, but also covers some of the tricky injection of |
| 55 | // fakes the unit tests currently do. |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 56 | // |
| 57 | // Note: If you get an runtime link error like: |
| 58 | // |
| 59 | // CANNOT LINK EXECUTABLE "/data/local/tmp/libsurfaceflinger_unittest": library "libclang_rt.asan-aarch64-android.so" not found |
| 60 | // |
| 61 | // it is because the address sanitizer shared objects are not installed |
| 62 | // by default in the system image. |
| 63 | // |
| 64 | // You can either "make dist tests" before flashing, or set this |
| 65 | // option to false temporarily. |
Lloyd Pique | e967d48 | 2018-08-31 11:04:49 -0700 | [diff] [blame] | 66 | address: true, |
| 67 | }, |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 68 | srcs: [ |
Alec Mouri | e5eb7de | 2022-01-15 00:34:20 +0000 | [diff] [blame] | 69 | ":libsurfaceflinger_mock_sources", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 70 | ":libsurfaceflinger_sources", |
Lloyd Pique | 067fe1e | 2018-12-06 19:44:13 -0800 | [diff] [blame] | 71 | "libsurfaceflinger_unittest_main.cpp", |
Xiang Wang | e12b4fa | 2022-03-25 23:48:40 +0000 | [diff] [blame^] | 72 | "AidlPowerHalWrapperTest.cpp", |
Valerie Hau | 6449968 | 2019-04-10 11:04:29 -0700 | [diff] [blame] | 73 | "CachingTest.cpp", |
Mikael Pessa | 2e1608f | 2019-07-19 11:25:35 -0700 | [diff] [blame] | 74 | "CompositionTest.cpp", |
Ady Abraham | 50c202a | 2019-03-14 11:44:38 -0700 | [diff] [blame] | 75 | "DispSyncSourceTest.cpp", |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 76 | "DisplayIdGeneratorTest.cpp", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 77 | "DisplayTransactionTest.cpp", |
Marin Shalamanov | 07b1ff3 | 2020-10-07 16:57:22 +0200 | [diff] [blame] | 78 | "DisplayDevice_GetBestColorModeTest.cpp", |
Ady Abraham | 690f461 | 2021-07-01 23:24:03 -0700 | [diff] [blame] | 79 | "DisplayDevice_InitiateModeChange.cpp", |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 80 | "DisplayDevice_SetDisplayBrightnessTest.cpp", |
Marin Shalamanov | 07b1ff3 | 2020-10-07 16:57:22 +0200 | [diff] [blame] | 81 | "DisplayDevice_SetProjectionTest.cpp", |
Lloyd Pique | 24b0a48 | 2018-03-09 18:52:26 -0800 | [diff] [blame] | 82 | "EventThreadTest.cpp", |
rnlee | 81d3260 | 2021-07-27 13:24:07 -0700 | [diff] [blame] | 83 | "FlagManagerTest.cpp", |
Alec Mouri | adebf5c | 2021-01-05 12:57:36 -0800 | [diff] [blame] | 84 | "FpsReporterTest.cpp", |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 85 | "FpsTest.cpp", |
Marin Shalamanov | 4a92f55 | 2021-03-29 18:38:27 +0200 | [diff] [blame] | 86 | "FramebufferSurfaceTest.cpp", |
Andy Yu | d6a3620 | 2022-01-26 04:08:22 -0800 | [diff] [blame] | 87 | "FrameRateOverrideMappingsTest.cpp", |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 88 | "FrameTimelineTest.cpp", |
Adithya Srinivasan | ac977e6 | 2021-05-21 22:50:56 +0000 | [diff] [blame] | 89 | "GameModeTest.cpp", |
Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 90 | "HWComposerTest.cpp", |
Ana Krulec | f2c006d | 2019-06-21 15:37:07 -0700 | [diff] [blame] | 91 | "OneShotTimerTest.cpp", |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 92 | "LayerHistoryTest.cpp", |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 93 | "LayerInfoTest.cpp", |
Evan Rosky | 1f6d6d5 | 2018-12-06 10:47:26 -0800 | [diff] [blame] | 94 | "LayerMetadataTest.cpp", |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 95 | "LayerTest.cpp", |
| 96 | "LayerTestUtils.cpp", |
Ady Abraham | 55fa727 | 2020-09-30 19:19:27 -0700 | [diff] [blame] | 97 | "MessageQueueTest.cpp", |
Marin Shalamanov | 07b1ff3 | 2020-10-07 16:57:22 +0200 | [diff] [blame] | 98 | "SurfaceFlinger_CreateDisplayTest.cpp", |
| 99 | "SurfaceFlinger_DestroyDisplayTest.cpp", |
Marin Shalamanov | c7e9f82 | 2021-11-16 20:07:55 +0100 | [diff] [blame] | 100 | "SurfaceFlinger_DisplayModeSwitching.cpp", |
Dominik Laskowski | 9e168db | 2021-05-27 16:05:12 -0700 | [diff] [blame] | 101 | "SurfaceFlinger_DisplayTransactionCommitTest.cpp", |
Marin Shalamanov | 07b1ff3 | 2020-10-07 16:57:22 +0200 | [diff] [blame] | 102 | "SurfaceFlinger_GetDisplayNativePrimariesTest.cpp", |
Dominik Laskowski | 0deb06e | 2021-04-16 23:18:31 -0700 | [diff] [blame] | 103 | "SurfaceFlinger_HotplugTest.cpp", |
Dominik Laskowski | 9e168db | 2021-05-27 16:05:12 -0700 | [diff] [blame] | 104 | "SurfaceFlinger_NotifyPowerBoostTest.cpp", |
Marin Shalamanov | 07b1ff3 | 2020-10-07 16:57:22 +0200 | [diff] [blame] | 105 | "SurfaceFlinger_OnInitializeDisplaysTest.cpp", |
| 106 | "SurfaceFlinger_SetDisplayStateTest.cpp", |
| 107 | "SurfaceFlinger_SetPowerModeInternalTest.cpp", |
| 108 | "SurfaceFlinger_SetupNewDisplayDeviceInternalTest.cpp", |
Ana Krulec | 0c8cd52 | 2018-08-31 12:27:28 -0700 | [diff] [blame] | 109 | "SchedulerTest.cpp", |
Ady Abraham | 60e42ea | 2020-03-09 19:17:31 -0700 | [diff] [blame] | 110 | "SetFrameRateTest.cpp", |
Alec Mouri | 0a1cc96 | 2019-03-14 12:33:02 -0700 | [diff] [blame] | 111 | "RefreshRateConfigsTest.cpp", |
Ana Krulec | c84d09b | 2019-11-02 23:10:29 +0100 | [diff] [blame] | 112 | "RefreshRateSelectionTest.cpp", |
Ana Krulec | 4593b69 | 2019-01-11 22:07:25 -0800 | [diff] [blame] | 113 | "RefreshRateStatsTest.cpp", |
Kevin DuBois | bb27bcd | 2019-04-02 14:34:35 -0700 | [diff] [blame] | 114 | "RegionSamplingTest.cpp", |
Yiwei Zhang | 16faa5d | 2018-11-13 18:12:59 -0800 | [diff] [blame] | 115 | "TimeStatsTest.cpp", |
Mikael Pessa | 90092f4 | 2019-08-26 17:22:04 -0700 | [diff] [blame] | 116 | "FrameTracerTest.cpp", |
Valerie Hau | d251afb | 2019-03-29 14:19:02 -0700 | [diff] [blame] | 117 | "TransactionApplicationTest.cpp", |
Adithya Srinivasan | b238cd5 | 2021-02-04 17:54:05 +0000 | [diff] [blame] | 118 | "TransactionFrameTracerTest.cpp", |
Vishnu Nair | 6b59115 | 2021-10-08 11:45:14 -0700 | [diff] [blame] | 119 | "TransactionProtoParserTest.cpp", |
Adithya Srinivasan | b9a7dab | 2021-01-14 23:49:46 +0000 | [diff] [blame] | 120 | "TransactionSurfaceFrameTest.cpp", |
Vishnu Nair | 7891e96 | 2021-11-11 12:07:21 -0800 | [diff] [blame] | 121 | "TransactionTracingTest.cpp", |
Galia Peycheva | 8f04b30 | 2021-04-27 13:25:38 +0200 | [diff] [blame] | 122 | "TunnelModeEnabledReporterTest.cpp", |
Kevin DuBois | a41be6a | 2019-09-09 11:06:33 -0700 | [diff] [blame] | 123 | "StrongTypingTest.cpp", |
Kevin DuBois | e4f27a8 | 2019-11-12 11:41:41 -0800 | [diff] [blame] | 124 | "VSyncDispatchTimerQueueTest.cpp", |
Kevin DuBois | cc27b50 | 2019-11-13 09:40:07 -0800 | [diff] [blame] | 125 | "VSyncDispatchRealtimeTest.cpp", |
Dominik Laskowski | a93a531 | 2020-07-23 15:10:03 -0700 | [diff] [blame] | 126 | "VsyncModulatorTest.cpp", |
Kevin DuBois | 1678e2c | 2019-08-22 12:26:24 -0700 | [diff] [blame] | 127 | "VSyncPredictorTest.cpp", |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 128 | "VSyncReactorTest.cpp", |
Ady Abraham | c581d3c | 2020-08-06 17:34:27 -0700 | [diff] [blame] | 129 | "VsyncConfigurationTest.cpp", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 130 | ], |
Vishnu Nair | 4df8eb6 | 2022-02-17 15:32:02 -0800 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | cc_defaults { |
| 134 | name: "libsurfaceflinger_mocks_defaults", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 135 | static_libs: [ |
Ady Abraham | e7385f7 | 2021-09-05 00:54:25 -0700 | [diff] [blame] | 136 | "android.hardware.common-V2-ndk", |
| 137 | "android.hardware.common.fmq-V1-ndk", |
Ady Abraham | a6388c0 | 2021-11-11 21:11:51 -0800 | [diff] [blame] | 138 | "android.hardware.graphics.common-V3-ndk", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 139 | "android.hardware.graphics.composer@2.1", |
| 140 | "android.hardware.graphics.composer@2.2", |
| 141 | "android.hardware.graphics.composer@2.3", |
| 142 | "android.hardware.graphics.composer@2.4", |
Ady Abraham | e7385f7 | 2021-09-05 00:54:25 -0700 | [diff] [blame] | 143 | "android.hardware.graphics.composer3-V1-ndk", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 144 | "android.hardware.power@1.0", |
| 145 | "android.hardware.power@1.1", |
| 146 | "android.hardware.power@1.2", |
| 147 | "android.hardware.power@1.3", |
Matt Buckley | 06f299a | 2021-09-24 19:43:51 +0000 | [diff] [blame] | 148 | "android.hardware.power-V2-cpp", |
Ady Abraham | e7385f7 | 2021-09-05 00:54:25 -0700 | [diff] [blame] | 149 | "libaidlcommonsupport", |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 150 | "libcompositionengine_mocks", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 151 | "libcompositionengine", |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 152 | "libframetimeline", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 153 | "libgmock", |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 154 | "libgui_mocks", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 155 | "liblayers_proto", |
Mikael Pessa | 2e1608f | 2019-07-19 11:25:35 -0700 | [diff] [blame] | 156 | "libperfetto_client_experimental", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 157 | "librenderengine", |
Dominik Laskowski | f6b4ba6 | 2021-11-09 12:46:10 -0800 | [diff] [blame] | 158 | "librenderengine_mocks", |
| 159 | "libscheduler", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 160 | "libserviceutils", |
| 161 | "libtimestats", |
Tej Singh | e275177 | 2021-04-06 22:05:29 -0700 | [diff] [blame] | 162 | "libtimestats_atoms_proto", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 163 | "libtimestats_proto", |
Alec Mouri | 465b296 | 2021-10-08 16:22:21 -0700 | [diff] [blame] | 164 | "libtonemap", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 165 | "libtrace_proto", |
Mikael Pessa | 2e1608f | 2019-07-19 11:25:35 -0700 | [diff] [blame] | 166 | "perfetto_trace_protos", |
| 167 | ], |
| 168 | shared_libs: [ |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 169 | "android.hardware.configstore-utils", |
| 170 | "android.hardware.configstore@1.0", |
| 171 | "android.hardware.configstore@1.1", |
| 172 | "android.hardware.graphics.allocator@2.0", |
| 173 | "android.hardware.graphics.allocator@3.0", |
| 174 | "android.hardware.graphics.common@1.2", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 175 | "libbase", |
| 176 | "libbinder", |
Ady Abraham | e7385f7 | 2021-09-05 00:54:25 -0700 | [diff] [blame] | 177 | "libbinder_ndk", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 178 | "libcutils", |
| 179 | "libEGL", |
| 180 | "libfmq", |
| 181 | "libGLESv1_CM", |
| 182 | "libGLESv2", |
| 183 | "libgui", |
| 184 | "libhidlbase", |
| 185 | "libinput", |
| 186 | "liblog", |
| 187 | "libnativewindow", |
| 188 | "libprocessgroup", |
| 189 | "libprotobuf-cpp-lite", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 190 | "libSurfaceFlingerProp", |
| 191 | "libsync", |
| 192 | "libui", |
| 193 | "libutils", |
rnlee | 81d3260 | 2021-07-27 13:24:07 -0700 | [diff] [blame] | 194 | "server_configurable_flags", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 195 | ], |
| 196 | header_libs: [ |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 197 | "android.hardware.graphics.composer3-command-buffer", |
Vishnu Nair | df6a4f6 | 2020-11-11 20:25:34 -0800 | [diff] [blame] | 198 | "android.hardware.graphics.composer@2.1-command-buffer", |
| 199 | "android.hardware.graphics.composer@2.2-command-buffer", |
| 200 | "android.hardware.graphics.composer@2.3-command-buffer", |
| 201 | "android.hardware.graphics.composer@2.4-command-buffer", |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 202 | "libscheduler_test_headers", |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 203 | "libsurfaceflinger_headers", |
| 204 | ], |
| 205 | } |
Vishnu Nair | 4df8eb6 | 2022-02-17 15:32:02 -0800 | [diff] [blame] | 206 | |
| 207 | cc_library_headers { |
| 208 | name: "libsurfaceflinger_mocks_headers", |
| 209 | export_include_dirs: ["."], |
| 210 | } |