# Copyright (c) 2023 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") import("//foundation/distributeddatamgr/udmf/udmf.gni") module_output_path = "udmf/innerkitsImpl" ############################################################################### config("module_private_config") { include_dirs = [ "${udmf_interfaces_path}/innerkits/client", "${udmf_interfaces_path}/innerkits/common", "${udmf_interfaces_path}/innerkits/data", "${udmf_interfaces_path}/innerkits/convert", "${udmf_interfaces_path}/ndk/data", "${udmf_framework_path}/common", "${udmf_framework_path}/innerkits/service", "${udmf_framework_path}/innerkitsimpl/client/", "${udmf_framework_path}/innerkitsimpl/test/unittest/mock/include", "${udmf_framework_path}/ndkimpl/data", ] } common_deps = [ "${udmf_interfaces_path}/innerkits:udmf_client", "${udmf_interfaces_path}/innerkits:utd_client", ] common_external_deps = [ "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "image_framework:image", "image_framework:image", "image_framework:image_native", "image_framework:pixelmap", "ipc:ipc_core", "kv_store:distributeddata_inner", "samgr:samgr_proxy", ] ohos_unittest("UdmfClientTest") { module_out_path = module_output_path sources = [ "${udmf_framework_path}/common/graph.cpp", "udmf_client_test.cpp", ] configs = [ ":module_private_config" ] deps = common_deps external_deps = common_external_deps } ohos_unittest("UdmfClientSystemHapTest") { module_out_path = module_output_path sources = [ "udmf_client_system_hap_test.cpp" ] configs = [ ":module_private_config" ] deps = common_deps external_deps = common_external_deps } ohos_unittest("UdmfClientHapPermissionTest") { module_out_path = module_output_path sources = [ "udmf_client_hap_permission_test.cpp" ] include_dirs = [ "${udmf_interfaces_path}/innerkits/client", "${udmf_interfaces_path}/innerkits/common", "${udmf_interfaces_path}/innerkits/data", "${udmf_interfaces_path}/innerkits/convert", "${udmf_framework_path}/common", "${udmf_framework_path}/innerkits/service", "${udmf_framework_path}/innerkitsimpl/client/", "${udmf_framework_path}/innerkitsimpl/test/unittest/mock/include", ] deps = common_deps external_deps = common_external_deps } ohos_unittest("UtdClientTest") { module_out_path = module_output_path sources = [ "${udmf_framework_path}/common/graph.cpp", "custom_utd_json_parser_test.cpp", "custom_utd_store_test.cpp", "graph_test.cpp", "utd_client_test.cpp", ] configs = [ ":module_private_config" ] deps = [ "${udmf_interfaces_path}/innerkits:utd_client" ] external_deps = common_external_deps } ohos_unittest("NdkDataConversionTest") { module_out_path = module_output_path sources = [ "${udmf_framework_path}/ndkimpl/data/udmf.cpp", "${udmf_framework_path}/ndkimpl/data/uds.cpp", "ndk_data_conversion_test.cpp", ] configs = [ ":module_private_config" ] deps = common_deps external_deps = common_external_deps } ohos_unittest("ApplicationDefineRecordTest") { module_out_path = module_output_path sources = [ "application_defined_record_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("AudioTest") { module_out_path = module_output_path sources = [ "audio_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("FileDataTest") { module_out_path = module_output_path sources = [ "file_test.cpp" ] configs = [ ":module_private_config" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("FlexibleTypeTest") { module_out_path = module_output_path sources = [ "flexible_type_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("FolderTest") { module_out_path = module_output_path sources = [ "folder_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("HtmlTest") { module_out_path = module_output_path sources = [ "html_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("ImageTest") { module_out_path = module_output_path sources = [ "image_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("LinkTest") { module_out_path = module_output_path sources = [ "link_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("PlainTextTest") { module_out_path = module_output_path sources = [ "plain_text_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("SystemDefinedAppitemTest") { module_out_path = module_output_path sources = [ "system_defined_appitem_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("SystemDefinedFormTest") { module_out_path = module_output_path sources = [ "system_defined_form_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("SystemDefinedPixelMapTest") { module_out_path = module_output_path sources = [ "system_defined_pixelmap_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("SystemDefinedRecordTest") { module_out_path = module_output_path sources = [ "system_defined_record_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("TextTest") { module_out_path = module_output_path sources = [ "text_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ohos_unittest("UnifiedDataTest") { module_out_path = module_output_path sources = [ "unified_data_test.cpp" ] deps = common_deps external_deps = common_external_deps defines = [ "private=public", "protected=public", ] } ############################################################################### group("unittest") { testonly = true deps = [ ":ApplicationDefineRecordTest", ":AudioTest", ":FileDataTest", ":FlexibleTypeTest", ":FolderTest", ":HtmlTest", ":ImageTest", ":LinkTest", ":NdkDataConversionTest", ":PlainTextTest", ":SystemDefinedAppitemTest", ":SystemDefinedFormTest", ":SystemDefinedPixelMapTest", ":SystemDefinedRecordTest", ":TextTest", ":UdmfClientHapPermissionTest", ":UdmfClientSystemHapTest", ":UdmfClientTest", ":UnifiedDataTest", ":UtdClientTest", ] } ###############################################################################