# 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("//build/test.gni") import("../../../time.gni") config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${api_path}/include", "include", "${time_utils_path}/native/include", "${time_service_path}/time/include", "${time_service_path}", "${time_service_path}/dfx/include", "${time_service_path}/ipc/stub", "${time_service_path}/ipc/base", "${time_service_path}/timer/include", ] cflags = [ "-fvisibility=hidden" ] cflags_cc = [ "-fvisibility-inlines-hidden" ] } module_output_path = "time_service/native" ohos_unittest("TimeServiceTest") { module_out_path = module_output_path sources = [ "src/time_service_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${api_path}:time_client", "${time_service_path}:time_system_ability_static", "//third_party/googletest:gtest_main", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "ability_base:want", "ability_runtime:runtime", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "power_manager:powermgr_client", "relational_store:native_dataability", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("TimeClientTest") { module_out_path = module_output_path sources = [ "src/time_client_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${api_path}:time_client", "${time_service_path}:time_system_ability_static", "//third_party/googletest:gtest_main", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "ability_base:want", "ability_runtime:runtime", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "power_manager:powermgr_client", "relational_store:native_dataability", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("TimeDfxTest") { module_out_path = module_output_path sources = [ "src/time_dfx_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${api_path}:time_client", "${time_service_path}:time_system_ability_static", "//third_party/googletest:gtest_main", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "ability_base:want", "ability_runtime:runtime", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "power_manager:powermgr_client", "relational_store:native_dataability", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("TimePermissionTest") { module_out_path = module_output_path sources = [ "src/time_permission_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${time_utils_path}:time_utils", "//third_party/googletest:gtest_main", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "ability_base:want", "ability_runtime:runtime", "ability_runtime:wantagent_innerkits", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("TimeProxyTest") { module_out_path = module_output_path sources = [ "src/time_proxy_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${api_path}:time_client", "${time_service_path}:time_system_ability_static", "//third_party/googletest:gtest_main", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "ability_base:want", "ability_runtime:runtime", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } group("unittest") { testonly = true deps = [ ":TimeClientTest", ":TimeDfxTest", ":TimePermissionTest", ":TimeProxyTest", ":TimeServiceTest", ] }