1# Copyright (c) 2022 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/updater/updater_default_cfg.gni")
15import("//build/ohos.gni")
16
17group("fuzztest") {
18  testonly = true
19  deps = [
20    "test/fuzztest/UpdaterFormatPartition_fuzzer:UpdaterFormatPartitionFuzzTest",
21    "test/fuzztest/UpdaterMountForPath_fuzzer:UpdaterMountForPathFuzzTest",
22    "test/fuzztest/UpdaterStartUpdaterProc_fuzzer:UpdaterStartUpdaterProcFuzzTest",
23    "test/fuzztest/applypatch_fuzzer:ApplyPatchFuzzTest",
24    "test/fuzztest/binflow_fuzzer:BinFlowFuzzTest",
25    "test/fuzztest/dopartitions_fuzzer:DoPartitionsFuzzTest",
26    "test/fuzztest/extractandexecutescript_fuzzer:ExtractAndExecuteScriptFuzzTest",
27    "test/fuzztest/getupdatepackageinfo_fuzzer:GetUpdatePackageInfoFuzzTest",
28    "test/fuzztest/package_fuzzer:PackageFuzzTest",
29    "test/fuzztest/readfstabfromfile_fuzzer:ReadFstabFromFileFuzzTest",
30    "test/fuzztest/rebootandinstallupgradepackage_fuzzer:RebootAndInstallUpgradePackageFuzzTest",
31    "test/fuzztest/scriptmanager_fuzzer:ScriptManagerFuzzTest",
32    "test/fuzztest/updaterfactoryreset_fuzzer:UpdaterFactoryResetFuzzTest",
33    "test/fuzztest/updatermain_fuzzer:UpdaterMainFuzzTest",
34    "test/fuzztest/updaterutils_fuzzer:UpdaterUtilsFuzzTest",
35    "test/fuzztest/writeupdatermsg_fuzzer:WriteUpdaterMsgFuzzTest",
36  ]
37}
38
39group("unittest") {
40  testonly = true
41  if (!use_libfuzzer) {
42    deps = [
43      "test/unittest:updater_unittest",
44      "test/unittest/applypatch_test:applypatch_unittest",
45      "test/unittest/common/ring_buffer:ring_buffer_test",
46      "test/unittest/factory_reset_test:factory_reset_unittest",
47      "test/unittest/flashd_test:flashd_unittest",
48      "test/unittest/flashd_test:flashd_utils_unittest",
49      "test/unittest/flow_update/update_bin:bin_flow_update_test",
50      "test/unittest/package:package_unittest",
51      "test/unittest/script:script_unittest",
52      "test/unittest/updater_binary:binary_unittest",
53      "test/unittest/utils:utils_test",
54    ]
55    if (updater_cfg_file == "") {
56      deps += [
57        "test/unittest/script:user_instruction",
58        "test/unittest/script:user_instruction_invalid",
59      ]
60    }
61    if (updater_ui_support) {
62      deps += [
63        "test/unittest/service_test:updater_service_unittest",
64        "test/unittest/updater_ui_test:ui_unittest",
65      ]
66    }
67  }
68}
69
70group("benchmarktest") {
71  testonly = true
72  deps = [ "test/benchmarktest:updater_benchmark_test" ]
73}
74