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_standard/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} 43 44## UnitTest vsync_connection_test }}} 45 46## UnitTest vsync_controller_test {{{ 47ohos_unittest("vsync_controller_test") { 48 module_out_path = module_out_path 49 50 sources = [ "vsync_controller_test.cpp" ] 51 52 deps = [ ":vsync_test_common" ] 53} 54 55## UnitTest vsync_controller_test }}} 56 57## UnitTest vsync_distributor_test {{{ 58ohos_unittest("vsync_distributor_test") { 59 module_out_path = module_out_path 60 61 sources = [ "vsync_distributor_test.cpp" ] 62 63 deps = [ 64 ":vsync_test_common", 65 "//foundation/graphic/graphic_2d/utils:socketpair", 66 ] 67} 68 69## UnitTest vsync_distributor_test }}} 70 71## UnitTest vsync_generator_test {{{ 72ohos_unittest("vsync_generator_test") { 73 module_out_path = module_out_path 74 75 sources = [ "vsync_generator_test.cpp" ] 76 77 deps = [ ":vsync_test_common" ] 78} 79 80## UnitTest vsync_generator_test }}} 81 82## UnitTest vsync_receiver_test {{{ 83ohos_unittest("vsync_receiver_test") { 84 module_out_path = module_out_path 85 86 sources = [ "vsync_receiver_test.cpp" ] 87 88 deps = [ 89 ":vsync_test_common", 90 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 91 "//foundation/graphic/graphic_2d/utils:socketpair", 92 ] 93} 94 95## UnitTest vsync_receiver_test }}} 96 97## UnitTest vsync_sampler_test {{{ 98ohos_unittest("vsync_sampler_test") { 99 module_out_path = module_out_path 100 101 sources = [ "vsync_sampler_test.cpp" ] 102 103 deps = [ ":vsync_test_common" ] 104} 105 106## UnitTest vsync_sampler_test }}} 107 108## UnitTest native {{{ 109ohos_unittest("native_vsync_test") { 110 module_out_path = module_out_path 111 112 sources = [ "native_vsync_test.cpp" ] 113 114 deps = [ ":vsync_test_common" ] 115} 116 117## UnitTest vsync_connection_test }}} 118 119## Build vsync_test_common.a {{{ 120config("vsync_test_common_public_config") { 121 include_dirs = [ 122 "//foundation/graphic/graphic_2d/interfaces/inner_api/common", 123 "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync/include", 124 ] 125 126 cflags = [ 127 "-Wall", 128 "-Werror", 129 "-g3", 130 "-Dprivate=public", 131 "-Dprotected=public", 132 ] 133} 134 135ohos_static_library("vsync_test_common") { 136 visibility = [ ":*" ] 137 testonly = true 138 139 public_configs = [ ":vsync_test_common_public_config" ] 140 141 public_deps = [ 142 "//foundation/graphic/graphic_2d/rosen/modules/composer/native_vsync:libnative_vsync", 143 "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync:libvsync", 144 "//third_party/googletest:gmock_main", 145 "//third_party/googletest:gtest_main", 146 ] 147 subsystem_name = "graphic" 148 part_name = "graphic_standard" 149} 150## Build vsync_test_common.a }}} 151