1# Copyright (c) 2021 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/test.gni") 15 16module_output_path = "updater/updateservice_test" 17config("utest_config") { 18 visibility = [ ":*" ] 19 20 cflags = [ 21 "-fprofile-arcs", 22 "-ftest-coverage", 23 "-Wno-implicit-fallthrough", 24 "-Wno-unused-function", 25 ] 26 cflags_cc = [ "-Wno-implicit-fallthrough" ] 27 28 ldflags = [ "--coverage" ] 29} 30 31ohos_unittest("updateservice_unittest") { 32 testonly = true 33 module_out_path = module_output_path 34 sources = [ 35 "update_client/client_stub.cpp", 36 "update_client/client_unittest.cpp", 37 "update_engine/server_unittest.cpp", 38 "update_server_ut_entry.cpp", 39 ] 40 41 sources += [ 42 "//base/update/updater/interfaces/kits/packages/package.cpp", 43 "//base/update/updater/interfaces/kits/updaterkits/updaterkits.cpp", 44 "//base/update/updateservice/callback/src/update_callback.cpp", 45 "//base/update/updateservice/callback/src/update_callback_proxy.cpp", 46 "//base/update/updateservice/callback/src/update_callback_stub.cpp", 47 "//base/update/updateservice/client/update_client.cpp", 48 "//base/update/updateservice/client/update_module.cpp", 49 "//base/update/updateservice/client/update_session.cpp", 50 "//base/update/updateservice/engine/src/progress_thread.cpp", 51 "//base/update/updateservice/engine/src/update_helper.cpp", 52 "//base/update/updateservice/engine/src/update_service.cpp", 53 "//base/update/updateservice/engine/src/update_service_stub.cpp", 54 "//base/update/updateservice/interfaces/innerkits/engine/update_service_kits_impl.cpp", 55 "//base/update/updateservice/interfaces/innerkits/engine/update_service_proxy.cpp", 56 ] 57 include_dirs = [ 58 "//base/update/updater/interfaces/kits/include/", 59 "//base/update/updater/interfaces/kits/include/package", 60 "//base/update/updateservice", 61 "//base/update/updateservice/interfaces/innerkits/include", 62 "//base/update/updateservice/client", 63 "//base/update/updateservice/engine/include", 64 "//base/update/updateservice/callback/include", 65 "//base/update/updater/utils/include/", 66 "//base/update/updater/services/include/", 67 "//base/update/updater/services/include/log", 68 "//base/update/updater/services/include/package", 69 "//base/update/updater/test/unittest", 70 "//third_party/bounds_checking_function/include", 71 "//third_party/googletest/googletest/include", 72 "//third_party/node/src", 73 "//foundation/ace/napi/interfaces/kits", 74 "//third_party/cJSON", 75 "//third_party/libxml2/include", 76 "//third_party/curl/include", 77 "//third_party/openssl/include", 78 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 79 "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", 80 "//foundation/distributedschedule/safwk/services/safwk/include", 81 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk", 82 "//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include", 83 "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", 84 ] 85 86 deps = [ 87 "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", 88 "//base/update/updater/interfaces/kits/misc_info:libmiscinfo", 89 "//base/update/updater/interfaces/kits/packages:libpackageExt", 90 "//base/update/updater/interfaces/kits/updaterkits:libupdaterkits", 91 "//base/update/updater/services/log:libupdaterlog", 92 "//base/update/updater/services/package:libupdaterpackage", 93 "//base/update/updater/utils:libutils", 94 "//third_party/bounds_checking_function:libsec_static", 95 "//third_party/cJSON:cjson_static", 96 "//third_party/curl:curl", 97 "//third_party/googletest:gmock_main", 98 "//third_party/googletest:gtest_main", 99 "//third_party/libxml2:xml2", 100 "//third_party/lz4:liblz4_static", 101 "//third_party/openssl:libcrypto_static", 102 "//third_party/openssl:ssl_source", 103 "//utils/native/base:utils", 104 ] 105 106 defines = [ 107 "UPDATER_UT", 108 "UPDATER_API_TEST", 109 ] 110 111 external_deps = [ 112 "hiviewdfx_hilog_native:libhilog", 113 "ipc:ipc_core", 114 "safwk:system_ability_fwk", 115 "samgr_standard:samgr_proxy", 116 "startup_l2:syspara", 117 ] 118 119 cflags_cc = [ "-fexceptions" ] 120 121 public_configs = [ ":utest_config" ] 122 install_enable = true 123 part_name = "update_service" 124} 125