1# Copyright (c) 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/ohos.gni") 15import("//build/test.gni") 16import("//foundation/ability/idl_tool/idl_tool.gni") 17 18module_output_path = "idl_tool/idl_tool" 19 20IDL_DIR = "../../" 21 22config("idl_tool_2_test_config") { 23 visibility = [ ":*" ] 24 include_dirs = [ "${IDL_DIR}/test/unittest/include" ] 25} 26 27common_sources = [ 28 "${IDL_DIR}/util/light_refcount_base.cpp", 29 "${IDL_DIR}/util/logger.cpp", 30 "${IDL_DIR}/util/string_builder.cpp", 31 "${IDL_DIR}/util/string_helper.cpp", 32 "${IDL_DIR}/util/string_pool.cpp", 33] 34 35ohos_unittest("IdlTool2UtilOptionsTest") { 36 module_out_path = module_output_path 37 include_dirs = [ "${IDL_DIR}" ] 38 39 configs = [ ":idl_tool_2_test_config" ] 40 sources = [ "./util_test/options_test.cpp" ] 41 sources += common_sources 42 43 deps = [] 44 45 external_deps = [ "c_utils:utils" ] 46 47 part_name = "idl_tool" 48 subsystem_name = "ability" 49} 50 51ohos_unittest("IdlTool2UtilStringTest") { 52 module_out_path = module_output_path 53 include_dirs = [ "${IDL_DIR}" ] 54 55 configs = [ ":idl_tool_2_test_config" ] 56 sources = [ "./util_test/string_test.cpp" ] 57 sources += common_sources 58 59 deps = [] 60 61 external_deps = [ "c_utils:utils" ] 62 63 part_name = "idl_tool" 64 subsystem_name = "ability" 65} 66 67group("unittest") { 68 testonly = true 69 deps = [ 70 #":IdlTool2UtilOptionsTest", 71 ":IdlTool2UtilStringTest", 72 "sa_type_emitter_test:unittest", 73 ] 74} 75