1# Copyright (c) 2023 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/unittest" 19 20IDL_DIR = "../../.." 21 22common_sources = [ 23 "${IDL_DIR}/codegen/code_emitter.cpp", 24 "${IDL_DIR}/codegen/code_generator.cpp", 25 "${IDL_DIR}/codegen/cpp_code_emitter.cpp", 26 "${IDL_DIR}/codegen/rust_code_emitter.cpp", 27 "${IDL_DIR}/codegen/ts_code_emitter.cpp", 28] 29 30common_sources += [ 31 "${IDL_DIR}/metadata/metadata_builder.cpp", 32 "${IDL_DIR}/metadata/metadata_dumper.cpp", 33 "${IDL_DIR}/metadata/metadata_reader.cpp", 34 "${IDL_DIR}/metadata/metadata_serializer.cpp", 35] 36 37common_sources += [ 38 "${IDL_DIR}/util/file.cpp", 39 "${IDL_DIR}/util/light_refcount_base.cpp", 40 "${IDL_DIR}/util/logger.cpp", 41 "${IDL_DIR}/util/options.cpp", 42 "${IDL_DIR}/util/string.cpp", 43 "${IDL_DIR}/util/string_builder.cpp", 44 "${IDL_DIR}/util/string_pool.cpp", 45] 46 47ohos_unittest("codegen_code_generator_test") { 48 module_out_path = module_output_path 49 include_dirs = [ "${IDL_TOOL_DIR}" ] 50 51 sources = [ "codegen_code_generator_test.cpp" ] 52 53 sources += common_sources 54 55 deps = [] 56 57 external_deps = [ "c_utils:utils" ] 58 59 part_name = "idl_tool" 60 subsystem_name = "ability" 61} 62 63group("unittest") { 64 testonly = true 65 deps = [ ":codegen_code_generator_test" ] 66} 67