1# Copyright (c) 2021-2022 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("../../../resmgr.gni") 16 17ohos_unittest("resmgr_test") { 18 module_out_path = "resource_management/resmgr" 19 20 defines = [ "CONFIG_HILOG" ] 21 22 sources = [ 23 "unittest/common/hap_manager_test.cpp", 24 "unittest/common/hap_parser_test.cpp", 25 "unittest/common/hap_resource_test.cpp", 26 "unittest/common/locale_info_test.cpp", 27 "unittest/common/res_config_impl_test.cpp", 28 "unittest/common/res_config_test.cpp", 29 "unittest/common/res_desc_test.cpp", 30 "unittest/common/resource_manager_performance_test.cpp", 31 "unittest/common/resource_manager_test.cpp", 32 "unittest/common/resource_manager_test_common.cpp", 33 "unittest/common/resource_manager_test_hap.cpp", 34 "unittest/common/resource_manager_test_media.cpp", 35 "unittest/common/resource_manager_test_string.cpp", 36 "unittest/common/string_utils_test.cpp", 37 "unittest/common/system_resource_manager_test.cpp", 38 "unittest/common/test_common.cpp", 39 "unittest/common/theme_config_test.cpp", 40 "unittest/common/theme_manager_test.cpp", 41 "unittest/utils/psue_manaer_test.cpp", 42 "unittest/utils/utils_test.cpp", 43 ] 44 45 cflags = [ 46 "-Dprivate=public", 47 "-Dprotected=public", 48 ] 49 50 include_dirs = [ 51 "unittest/common", 52 "../include", 53 "../../../interfaces/inner_api/include", 54 ] 55 56 deps = [ 57 "../:global_resmgr", 58 "//third_party/cJSON:cjson", 59 "//third_party/googletest:gtest_main", 60 ] 61 62 if (resource_management_support_icu) { 63 include_dirs += [ 64 "//third_party/icu/icu4c/source", 65 "//third_party/icu/icu4c/source/i18n", 66 ] 67 defines += [ "SUPPORT_GRAPHICS" ] 68 deps += [ "//third_party/icu/icu4c:shared_icuuc" ] 69 } 70 71 external_deps = [ 72 "ability_base:extractortool", 73 "hilog:libhilog", 74 "zlib:libz", 75 ] 76 77 resource_config_file = "../../../test/resource/ohos_test.xml" 78} 79 80group("unittest") { 81 testonly = true 82 deps = [ ":resmgr_test" ] 83} 84