1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/test.gni") 15 16module_out_path = "graphic_2d/composer" 17 18group("unittest") { 19 testonly = true 20 21 deps = [ 22 ":native_vsync_test", 23 ":vsync_connection_test", 24 ":vsync_controller_test", 25 ":vsync_distributor_test", 26 ":vsync_generator_test", 27 ":vsync_receiver_test", 28 ":vsync_sampler_test", 29 ] 30} 31 32## UnitTest vsync_connection_test {{{ 33ohos_unittest("vsync_connection_test") { 34 module_out_path = module_out_path 35 36 sources = [ "vsync_connection_test.cpp" ] 37 38 deps = [ 39 ":vsync_test_common", 40 "//foundation/graphic/graphic_2d/utils:socketpair", 41 ] 42 external_deps = [ "c_utils:utils" ] 43} 44 45## UnitTest vsync_connection_test }}} 46 47## UnitTest vsync_controller_test {{{ 48ohos_unittest("vsync_controller_test") { 49 module_out_path = module_out_path 50 51 sources = [ "vsync_controller_test.cpp" ] 52 53 deps = [ ":vsync_test_common" ] 54 external_deps = [ "c_utils:utils" ] 55} 56 57## UnitTest vsync_controller_test }}} 58 59## UnitTest vsync_distributor_test {{{ 60ohos_unittest("vsync_distributor_test") { 61 module_out_path = module_out_path 62 63 sources = [ "vsync_distributor_test.cpp" ] 64 65 deps = [ 66 ":vsync_test_common", 67 "//foundation/graphic/graphic_2d/utils:socketpair", 68 ] 69 external_deps = [ "c_utils:utils" ] 70} 71 72## UnitTest vsync_distributor_test }}} 73 74## UnitTest vsync_generator_test {{{ 75ohos_unittest("vsync_generator_test") { 76 module_out_path = module_out_path 77 78 sources = [ "vsync_generator_test.cpp" ] 79 80 deps = [ ":vsync_test_common" ] 81 external_deps = [ "c_utils:utils" ] 82} 83 84## UnitTest vsync_generator_test }}} 85 86## UnitTest vsync_receiver_test {{{ 87ohos_unittest("vsync_receiver_test") { 88 module_out_path = module_out_path 89 90 sources = [ "vsync_receiver_test.cpp" ] 91 92 deps = [ 93 ":vsync_test_common", 94 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 95 "//foundation/graphic/graphic_2d/utils:socketpair", 96 ] 97 external_deps = [ "c_utils:utils" ] 98} 99 100## UnitTest vsync_receiver_test }}} 101 102## UnitTest vsync_sampler_test {{{ 103ohos_unittest("vsync_sampler_test") { 104 module_out_path = module_out_path 105 106 sources = [ "vsync_sampler_test.cpp" ] 107 108 deps = [ ":vsync_test_common" ] 109 external_deps = [ "c_utils:utils" ] 110} 111 112## UnitTest vsync_sampler_test }}} 113 114## UnitTest native {{{ 115ohos_unittest("native_vsync_test") { 116 module_out_path = module_out_path 117 118 sources = [ "native_vsync_test.cpp" ] 119 120 deps = [ ":vsync_test_common" ] 121} 122 123## UnitTest vsync_connection_test }}} 124 125## Build vsync_test_common.a {{{ 126config("vsync_test_common_public_config") { 127 include_dirs = [ 128 "//foundation/graphic/graphic_2d/interfaces/inner_api/common", 129 "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync/include", 130 ] 131 132 cflags = [ 133 "-Wall", 134 "-Werror", 135 "-g3", 136 "-Dprivate=public", 137 "-Dprotected=public", 138 ] 139} 140 141ohos_static_library("vsync_test_common") { 142 visibility = [ ":*" ] 143 testonly = true 144 145 public_configs = [ ":vsync_test_common_public_config" ] 146 147 public_deps = [ 148 "//foundation/graphic/graphic_2d/rosen/modules/composer/native_vsync:libnative_vsync", 149 "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync:libvsync", 150 "//third_party/googletest:gmock_main", 151 "//third_party/googletest:gtest_main", 152 ] 153 subsystem_name = "graphic" 154 part_name = "graphic_2d" 155} 156## Build vsync_test_common.a }}} 157