# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") module_out_path = "graphic_2d/composer" group("unittest") { testonly = true deps = [ ":native_vsync_test", ":vsync_connection_test", ":vsync_controller_test", ":vsync_distributor_test", ":vsync_generator_test", ":vsync_receiver_test", ":vsync_sampler_test", ] } ## UnitTest vsync_connection_test {{{ ohos_unittest("vsync_connection_test") { module_out_path = module_out_path sources = [ "vsync_connection_test.cpp" ] deps = [ ":vsync_test_common", "//foundation/graphic/graphic_2d/utils:socketpair", ] } ## UnitTest vsync_connection_test }}} ## UnitTest vsync_controller_test {{{ ohos_unittest("vsync_controller_test") { module_out_path = module_out_path sources = [ "vsync_controller_test.cpp" ] deps = [ ":vsync_test_common" ] } ## UnitTest vsync_controller_test }}} ## UnitTest vsync_distributor_test {{{ ohos_unittest("vsync_distributor_test") { module_out_path = module_out_path sources = [ "vsync_distributor_test.cpp" ] deps = [ ":vsync_test_common", "//foundation/graphic/graphic_2d/utils:socketpair", ] } ## UnitTest vsync_distributor_test }}} ## UnitTest vsync_generator_test {{{ ohos_unittest("vsync_generator_test") { module_out_path = module_out_path sources = [ "vsync_generator_test.cpp" ] deps = [ ":vsync_test_common" ] } ## UnitTest vsync_generator_test }}} ## UnitTest vsync_receiver_test {{{ ohos_unittest("vsync_receiver_test") { module_out_path = module_out_path sources = [ "vsync_receiver_test.cpp" ] deps = [ ":vsync_test_common", "../../../../../modules/platform:eventhandler", "../../../../../modules/render_service_client:librender_service_client", "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", "//foundation/graphic/graphic_2d/utils:socketpair", ] } ## UnitTest vsync_receiver_test }}} ## UnitTest vsync_sampler_test {{{ ohos_unittest("vsync_sampler_test") { module_out_path = module_out_path sources = [ "vsync_sampler_test.cpp" ] deps = [ ":vsync_test_common" ] } ## UnitTest vsync_sampler_test }}} ## UnitTest native {{{ ohos_unittest("native_vsync_test") { module_out_path = module_out_path sources = [ "native_vsync_test.cpp" ] deps = [ ":vsync_test_common" ] } ## UnitTest vsync_connection_test }}} ## Build vsync_test_common.a {{{ config("vsync_test_common_public_config") { include_dirs = [ "//foundation/graphic/graphic_2d/interfaces/inner_api/common", "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync/include", ] cflags = [ "-Wall", "-Werror", "-g3", "-Dprivate=public", "-Dprotected=public", ] } ohos_static_library("vsync_test_common") { visibility = [ ":*" ] testonly = true public_configs = [ ":vsync_test_common_public_config" ] public_deps = [ "//foundation/graphic/graphic_2d/rosen/modules/composer/native_vsync:libnative_vsync", "//foundation/graphic/graphic_2d/rosen/modules/composer/vsync:libvsync", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] public_external_deps = [ "c_utils:utils", "graphic_surface:surface", ] subsystem_name = "graphic" part_name = "graphic_2d" } ## Build vsync_test_common.a }}}