# Copyright (c) 2021-2022 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/ability/ability_base/ability_base.gni") ###################################################################### base_output_path = "aafwk/base_test" ###################################################################### config("base_private_config") { visibility = [ ":*" ] } ohos_unittest("base_object_test") { module_out_path = base_output_path sources = [ "base/base_object_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("base_test") { module_out_path = base_output_path sources = [ "base/base_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("bool_wrapper_test") { module_out_path = base_output_path sources = [ "base/bool_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("byte_wrapper_test") { module_out_path = base_output_path sources = [ "base/byte_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("double_wrapper_test") { module_out_path = base_output_path sources = [ "base/double_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("float_wrapper_test") { module_out_path = base_output_path sources = [ "base/float_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("int_wrapper_test") { module_out_path = base_output_path sources = [ "base/int_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ohos_unittest("long_wrapper_test") { module_out_path = base_output_path sources = [ "base/long_wrapper_test.cpp" ] configs = [ ":base_private_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "c_utils:utils", ] } ###################################################################### want_output_path = "ability_base/want_test" ###################################################################### config("want_private_config") { defines = [ "ABILITYBASE_LOG_TAG = \"WantUnitTest\"" ] } config("module_private_want_param_wrapper_config") { defines = [ "ABILITYBASE_LOG_TAG = \"WantUnitTest\"" ] } ohos_unittest("operation_test") { module_out_path = want_output_path sources = [ "want/operation_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("patterns_matcher_test") { module_out_path = want_output_path sources = [ "want/patterns_matcher_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "${ability_base_path}:base", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", ] } ohos_unittest("skills_test") { module_out_path = want_output_path sources = [ "want/skills_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", ] } ohos_unittest("want_params_test") { module_out_path = want_output_path sources = [ "want/want_params_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "${ability_base_path}:base", "${ability_base_path}:want", "//third_party/googletest:gtest_main", ] external_deps = [ "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] } ohos_unittest("want_params_wrapper_test") { module_out_path = want_output_path sources = [ "want/want_params_wrapper_test.cpp" ] configs = [ ":module_private_want_param_wrapper_config" ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] } ohos_unittest("want_test") { module_out_path = want_output_path sources = [ "want/want_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", ] } ohos_unittest("uri_test") { module_out_path = want_output_path sources = [ "want/uri_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", "hilog:libhilog", ] } ohos_unittest("extra_params_test") { module_out_path = want_output_path sources = [ "want/extra_params_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("array_wrapper_test") { module_out_path = want_output_path sources = [ "want/array_wrapper_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("zchar_wrapper_test") { module_out_path = base_output_path sources = [ "base/zchar_wrapper_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("short_wrapper_test") { module_out_path = base_output_path sources = [ "base/short_wrapper_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("string_wrapper_test") { module_out_path = base_output_path sources = [ "base/string_wrapper_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ohos_unittest("user_object_wrapper_test") { module_out_path = base_output_path sources = [ "base/user_object_wrapper_test.cpp" ] configs = [ ":want_private_config", "${ability_base_path}:want_public_config", ] deps = [ "//third_party/googletest:gtest_main" ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", ] } ###################################################################### extractor_output_path = "ability_base/extractor_test" ###################################################################### config("extractor_private_config") { visibility = [ ":*" ] include_dirs = [ "{ability_base_path}/interfaces/kits/native/extractor/include", "//third_party/zlib/contrib/minizip", "//third_party/zlib", ] defines = [ "ABILITYBASE_LOG_TAG = \"ExtractorTest\"" ] } ohos_unittest("extractor_test") { module_out_path = extractor_output_path sources = [ "extractor/extractor_test.cpp" ] configs = [ ":extractor_private_config" ] deps = [ "//third_party/googletest:gtest_main", "//third_party/zlib:shared_libz", ] external_deps = [ "ability_base:extractortool", "ability_base:extractresourcemanager", "ability_base:string_utils", "c_utils:utils", "hilog:libhilog", ] } ###################################################################### viewdata_output_path = "ability_base/view_data_test" ###################################################################### config("viewdata_private_config") { visibility = [ ":*" ] include_dirs = [ "{ability_base_path}/interfaces/kits/native/view_data/include", "//third_party/zlib/contrib/minizip", "//third_party/zlib", ] defines = [ "ABILITYBASE_LOG_TAG = \"ViewDataTest\"" ] } ohos_unittest("view_data_test") { module_out_path = viewdata_output_path sources = [ "viewdata/view_data_test.cpp" ] configs = [ ":viewdata_private_config" ] deps = [ "//third_party/googletest:gtest_main", "//third_party/zlib:shared_libz", ] external_deps = [ "ability_base:base", "ability_base:session_info", "ability_base:string_utils", "ability_base:view_data", "ability_base:want", "ability_base:zuri", "c_utils:utils", "hilog:libhilog", ] } ###################################################################### group("unittest") { testonly = true deps = [ #":base_test", ":array_wrapper_test", ":base_object_test", ":bool_wrapper_test", ":byte_wrapper_test", ":double_wrapper_test", ":extra_params_test", ":extractor_test", ":float_wrapper_test", ":int_wrapper_test", ":long_wrapper_test", ":operation_test", ":patterns_matcher_test", ":short_wrapper_test", ":skills_test", ":string_wrapper_test", ":uri_test", ":user_object_wrapper_test", ":view_data_test", ":want_params_test", ":want_params_wrapper_test", ":want_test", ":zchar_wrapper_test", ] }