1# Copyright (c) 2022-2025 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") 15import("../../../windowmanager_aafwk.gni") 16 17module_out_path = "window_manager/OH-DMS/snapshot" 18 19group("unittest") { 20 testonly = true 21 22 deps = [ 23 ":snapshot_display_test", 24 ":snapshot_utils_test", 25 ] 26} 27 28ohos_unittest("snapshot_utils_test") { 29 module_out_path = module_out_path 30 31 sources = [ "snapshot_utils_test.cpp" ] 32 33 deps = [ ":utils_unittest_common" ] 34 35 external_deps = [ 36 "cJSON:cjson_static", 37 "c_utils:utils", 38 "hilog:libhilog", 39 "selinux_adapter:librestorecon", 40 ] 41} 42 43ohos_unittest("snapshot_display_test") { 44 module_out_path = module_out_path 45 46 sources = [ "snapshot_display_test.cpp" ] 47 48 deps = [ ":utils_unittest_common" ] 49 50 external_deps = [ 51 "cJSON:cjson_static", 52 "c_utils:utils", 53 "hilog:libhilog", 54 "selinux_adapter:librestorecon", 55 ] 56} 57 58## Build utils_unittest_common.a {{{ 59config("utils_unittest_common_public_config") { 60 include_dirs = [ 61 "../../../dmserver/include", 62 "../../../interfaces/innerkits/dm", 63 "../../../interfaces/innerkits/wm", 64 "../../include", 65 "../../../test/common/utils/include", 66 "../../../utils/include", 67 "${dmserver_gen_path}", 68 ] 69} 70 71ohos_static_library("utils_unittest_common") { 72 visibility = [ ":*" ] 73 testonly = true 74 75 public_configs = [ 76 ":utils_unittest_common_public_config", 77 "../../../resources/config/build:coverage_flags", 78 "../../../resources/config/build:testcase_flags", 79 ] 80 81 public_deps = [ 82 "../..:libsnapshot_util", 83 "../../../dm:libdm", 84 "../../../test/common/utils:libtestutil", 85 "../../../utils:libwmutil", 86 "../../../utils:libwmutil_base", 87 ] 88 89 public_external_deps = [ 90 "c_utils:utils", 91 "googletest:gmock", 92 "googletest:gtest_main", 93 "graphic_2d:2d_graphics", 94 "graphic_2d:librender_service_base", 95 "graphic_2d:librender_service_client", 96 "image_framework:image_native", 97 ] 98 99 external_deps = [ 100 "access_token:libaccesstoken_sdk", 101 "access_token:libnativetoken", 102 "access_token:libtoken_setproc", 103 "c_utils:utils", 104 "graphic_2d:librender_service_base", 105 "hilog:libhilog", 106 "ipc:ipc_single", 107 ] 108 109 subsystem_name = "window" 110 part_name = "window_manager" 111} 112## Build utils_unittest_common.a }}} 113