# Copyright (c) 2021-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("//base/notification/distributed_notification_service/notification.gni") import("//build/ohos.gni") import("//build/test.gni") module_output_path = "${component_name}/moduletest" config("public_ans_config") { include_dirs = [ "${core_path}/common/include", "${services_path}/ans/include", "${core_path}/include", ] } ohos_moduletest("ans_fw_module_test") { module_out_path = module_output_path include_dirs = [ "include", "${core_path}/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${component_path}/services/ans/include", "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/test/moduletest/mock/include", "${ffrt_path}/interfaces/kits", ] sources = [ "ans_fw_module_test.cpp", "mock/blob.cpp", "mock/distributed_kv_data_manager.cpp", "mock/mock_accesstoken_kit.cpp", "mock/mock_bundle_manager.cpp", "mock/mock_bundle_manager_helper.cpp", "mock/mock_bundle_mgr_proxy.cpp", "mock/mock_change_notification.cpp", "mock/mock_common_event_data.cpp", "mock/mock_common_event_manager.cpp", "mock/mock_ipc.cpp", "mock/mock_single_kv_store.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", "//third_party/googletest:gtest_main", ] defines = [] if (distributed_notification_supported) { defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] deps += [ "${services_path}/distributed:libans_distributed" ] } external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } ohos_moduletest("ans_innerkits_module_publish_test") { sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path include_dirs = [ "include", "${core_path}/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${component_path}/services/ans/include", "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/test/moduletest/mock/include", "${ffrt_path}/interfaces/kits", ] sources = [ "${test_path}/mock/mock_tokenid_kit.cpp", "ans_innerkits_module_publish_test.cpp", "mock/mock_accesstoken_kit.cpp", "mock/mock_bundle_manager.cpp", "mock/mock_bundle_manager_helper.cpp", "mock/mock_ipc.cpp", "mock/remote_native_token.cpp", ] deps = [ "${ability_runtime_path}/frameworks/native/appkit:app_context", "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", "//third_party/googletest:gtest_main", ] defines = [] if (distributed_notification_supported) { defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] deps += [ "${services_path}/distributed:libans_distributed" ] } external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } ohos_moduletest("ans_innerkits_module_slot_test") { module_out_path = module_output_path include_dirs = [ "include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/ans/core/common/include", "${frameworks_path}/ans/core/include", "${component_path}/services/ans/include", "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/test/moduletest/mock/include", "${ffrt_path}/interfaces/kits", ] sources = [ "${test_path}/mock/mock_tokenid_kit.cpp", "ans_innerkits_module_slot_test.cpp", "mock/distributed_kv_data_manager.cpp", "mock/mock_accesstoken_kit.cpp", "mock/mock_bundle_manager.cpp", "mock/mock_bundle_manager_helper.cpp", "mock/mock_ipc.cpp", "mock/mock_single_kv_store.cpp", "mock/remote_native_token.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", "//third_party/googletest:gtest_main", ] defines = [] if (distributed_notification_supported) { defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] deps += [ "${services_path}/distributed:libans_distributed" ] } external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } ohos_moduletest("ans_innerkits_module_setting_test") { sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path include_dirs = [ "include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/ans/core/common/include", "${frameworks_path}/ans/core/include", "${component_path}/services/ans/include", "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", "${inner_api_path}", "${frameworks_path}/test/moduletest/mock/include", "${ffrt_path}/interfaces/kits", ] sources = [ "ans_innerkits_module_setting_test.cpp", "mock/distributed_kv_data_manager.cpp", "mock/mock_bundle_manager_helper.cpp", "mock/mock_ipc.cpp", "mock/mock_single_kv_store.cpp", "mock/remote_native_token.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", "//third_party/googletest:gtest_main", ] defines = [] if (distributed_notification_supported) { defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] deps += [ "${services_path}/distributed:libans_distributed" ] } external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } ohos_js_unittest("ReminderAgentJsTest") { module_out_path = module_output_path hap_profile = "./config.json" certificate_profile = "//test/testfwk/developer_test/signature/openharmony_sx.p7b" } group("moduletest") { testonly = true deps = [] deps += [ # ":ReminderAgentJsTest", # ":ans_fw_module_test", ":ans_innerkits_module_publish_test", ":ans_innerkits_module_setting_test", ":ans_innerkits_module_slot_test", ] }