1fb299fa2Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd. 2fb299fa2Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3fb299fa2Sopenharmony_ci# you may not use this file except in compliance with the License. 4fb299fa2Sopenharmony_ci# You may obtain a copy of the License at 5fb299fa2Sopenharmony_ci# 6fb299fa2Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7fb299fa2Sopenharmony_ci# 8fb299fa2Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9fb299fa2Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10fb299fa2Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11fb299fa2Sopenharmony_ci# See the License for the specific language governing permissions and 12fb299fa2Sopenharmony_ci# limitations under the License. 13fb299fa2Sopenharmony_ci 14fb299fa2Sopenharmony_ciimport("//base/update/updater/updater_default_cfg.gni") 15fb299fa2Sopenharmony_ciimport("//build/ohos.gni") 16fb299fa2Sopenharmony_ci 17fb299fa2Sopenharmony_cigroup("fuzztest") { 18fb299fa2Sopenharmony_ci testonly = true 19fb299fa2Sopenharmony_ci deps = [ 20fb299fa2Sopenharmony_ci "test/fuzztest/UpdaterFormatPartition_fuzzer:UpdaterFormatPartitionFuzzTest", 21fb299fa2Sopenharmony_ci "test/fuzztest/UpdaterMountForPath_fuzzer:UpdaterMountForPathFuzzTest", 22fb299fa2Sopenharmony_ci "test/fuzztest/UpdaterStartUpdaterProc_fuzzer:UpdaterStartUpdaterProcFuzzTest", 23fb299fa2Sopenharmony_ci "test/fuzztest/applypatch_fuzzer:ApplyPatchFuzzTest", 24fb299fa2Sopenharmony_ci "test/fuzztest/binflow_fuzzer:BinFlowFuzzTest", 25fb299fa2Sopenharmony_ci "test/fuzztest/dopartitions_fuzzer:DoPartitionsFuzzTest", 26fb299fa2Sopenharmony_ci "test/fuzztest/extractandexecutescript_fuzzer:ExtractAndExecuteScriptFuzzTest", 27fb299fa2Sopenharmony_ci "test/fuzztest/getupdatepackageinfo_fuzzer:GetUpdatePackageInfoFuzzTest", 28fb299fa2Sopenharmony_ci "test/fuzztest/package_fuzzer:PackageFuzzTest", 29fb299fa2Sopenharmony_ci "test/fuzztest/readfstabfromfile_fuzzer:ReadFstabFromFileFuzzTest", 30fb299fa2Sopenharmony_ci "test/fuzztest/rebootandinstallupgradepackage_fuzzer:RebootAndInstallUpgradePackageFuzzTest", 31fb299fa2Sopenharmony_ci "test/fuzztest/scriptmanager_fuzzer:ScriptManagerFuzzTest", 32fb299fa2Sopenharmony_ci "test/fuzztest/updaterfactoryreset_fuzzer:UpdaterFactoryResetFuzzTest", 33fb299fa2Sopenharmony_ci "test/fuzztest/updatermain_fuzzer:UpdaterMainFuzzTest", 34fb299fa2Sopenharmony_ci "test/fuzztest/updaterutils_fuzzer:UpdaterUtilsFuzzTest", 35fb299fa2Sopenharmony_ci "test/fuzztest/writeupdatermsg_fuzzer:WriteUpdaterMsgFuzzTest", 36fb299fa2Sopenharmony_ci ] 37fb299fa2Sopenharmony_ci} 38fb299fa2Sopenharmony_ci 39fb299fa2Sopenharmony_cigroup("unittest") { 40fb299fa2Sopenharmony_ci testonly = true 41fb299fa2Sopenharmony_ci if (!use_libfuzzer) { 42fb299fa2Sopenharmony_ci deps = [ 43fb299fa2Sopenharmony_ci "test/unittest:updater_unittest", 44fb299fa2Sopenharmony_ci "test/unittest/applypatch_test:applypatch_unittest", 45fb299fa2Sopenharmony_ci "test/unittest/common/ring_buffer:ring_buffer_test", 46fb299fa2Sopenharmony_ci "test/unittest/factory_reset_test:factory_reset_unittest", 47fb299fa2Sopenharmony_ci "test/unittest/flashd_test:flashd_unittest", 48fb299fa2Sopenharmony_ci "test/unittest/flashd_test:flashd_utils_unittest", 49fb299fa2Sopenharmony_ci "test/unittest/flow_update/update_bin:bin_flow_update_test", 50fb299fa2Sopenharmony_ci "test/unittest/package:package_unittest", 51fb299fa2Sopenharmony_ci "test/unittest/script:script_unittest", 52fb299fa2Sopenharmony_ci "test/unittest/updater_binary:binary_unittest", 53fb299fa2Sopenharmony_ci "test/unittest/utils:utils_test", 54fb299fa2Sopenharmony_ci ] 55fb299fa2Sopenharmony_ci if (updater_cfg_file == "") { 56fb299fa2Sopenharmony_ci deps += [ 57fb299fa2Sopenharmony_ci "test/unittest/script:user_instruction", 58fb299fa2Sopenharmony_ci "test/unittest/script:user_instruction_invalid", 59fb299fa2Sopenharmony_ci ] 60fb299fa2Sopenharmony_ci } 61fb299fa2Sopenharmony_ci if (updater_ui_support) { 62fb299fa2Sopenharmony_ci deps += [ 63fb299fa2Sopenharmony_ci "test/unittest/service_test:updater_service_unittest", 64fb299fa2Sopenharmony_ci "test/unittest/updater_ui_test:ui_unittest", 65fb299fa2Sopenharmony_ci ] 66fb299fa2Sopenharmony_ci } 67fb299fa2Sopenharmony_ci } 68fb299fa2Sopenharmony_ci} 69fb299fa2Sopenharmony_ci 70fb299fa2Sopenharmony_cigroup("benchmarktest") { 71fb299fa2Sopenharmony_ci testonly = true 72fb299fa2Sopenharmony_ci deps = [ "test/benchmarktest:updater_benchmark_test" ] 73fb299fa2Sopenharmony_ci} 74