1# Copyright (c) 2024 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("//base/update/updateservice/services/engine/engine_sa.gni") 15import("//base/update/updateservice/updateengine.gni") 16import("//build/test.gni") 17 18module_output_path = "$updateengine_part_name/$updateengine_unittest_name" 19 20ohos_unittest("firmware_stream_installer_install_test") { 21 module_out_path = module_output_path 22 include_dirs = sa_include_dirs 23 deps = sa_deps 24 external_deps = sa_external_deps 25 defines = [ 26 "UPDATER_UT", 27 "RELATIONAL_STORE_NATIVE_RDB_ENABLE", 28 ] 29 sources = [ 30 "$firmware_root_path/data/db/src/firmware_component_operator.cpp", 31 "$firmware_root_path/data/db/src/firmware_component_table.cpp", 32 "$firmware_root_path/data/db/src/firmware_database.cpp", 33 "$firmware_root_path/data/db/src/firmware_database_callback.cpp", 34 "$firmware_root_path/data/db/src/firmware_task_operator.cpp", 35 "$firmware_root_path/data/db/src/firmware_task_table.cpp", 36 "$firmware_root_path/upgrade/install/src/firmware_install.cpp", 37 "$firmware_root_path/upgrade/install/src/firmware_stream_installer_install.cpp", 38 "$sqlite_root_path/core/src/sqlite_db.cpp", 39 "$updateengine_root_path/test/unittest/stream_install/firmware_stream_installer_install_test.cpp", 40 ] 41 external_deps += [ "googletest:gtest_main" ] 42 part_name = updateengine_part_name 43} 44 45ohos_unittest("stream_progress_thread_test") { 46 module_out_path = module_output_path 47 include_dirs = sa_include_dirs 48 deps = sa_deps 49 external_deps = sa_external_deps 50 defines = [ "UPDATER_UT" ] 51 sources = [ 52 "$updateengine_root_path/services/engine/src/progress_thread.cpp", 53 "$updateengine_root_path/services/engine/src/stream_progress_thread.cpp", 54 "$updateengine_root_path/test/unittest/stream_install/stream_progress_thread_test.cpp", 55 ] 56 external_deps += [ "googletest:gtest_main" ] 57 part_name = updateengine_part_name 58} 59 60group("stream_install_unittest") { 61 testonly = true 62 deps = [ 63 ":firmware_stream_installer_install_test", 64 ":stream_progress_thread_test", 65 ] 66} 67