1# Copyright (c) 2021-2023 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")
15import("../../../bundletool.gni")
16
17module_output_path = "bundle_tool/tools"
18
19ohos_systemtest("bm_command_install_system_test") {
20  module_out_path = module_output_path
21
22  sources = [
23    "bm_command_install_system_test.cpp",
24    "tool_system_test.cpp",
25  ]
26
27  configs = [
28    "${bundletool_path}:tools_bm_config",
29    "${bundletool_test_path}/unittest/bm:tools_bm_config_mock",
30  ]
31
32  cflags = []
33  if (target_cpu == "arm") {
34    cflags += [ "-DBINDER_IPC_32BIT" ]
35  }
36
37  deps = [
38    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForInstall:pageAbilityBundleForInstall",
39    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForUninstall:pageAbilityBundleForUninstall",
40    "${bundle_framework_path}/test/sceneProject/tools/ohos_test:copy_ohos_test",
41    "//third_party/googletest:gtest_main",
42  ]
43
44  external_deps = [
45    "ability_base:base",
46    "ability_base:configuration",
47    "ability_base:want",
48    "bundle_framework:appexecfwk_core",
49    "bundle_framework:bundle_napi_common",
50    "hilog:libhilog",
51    "ipc:ipc_core",
52    "os_account:os_account_innerkits",
53  ]
54
55  external_deps += bm_install_external_deps
56}
57
58ohos_systemtest("bm_command_uninstall_system_test") {
59  module_out_path = module_output_path
60
61  sources = [
62    "bm_command_uninstall_system_test.cpp",
63    "tool_system_test.cpp",
64  ]
65
66  configs = [
67    "${bundletool_path}:tools_bm_config",
68    "${bundletool_test_path}/unittest/bm:tools_bm_config_mock",
69  ]
70
71  cflags = []
72  if (target_cpu == "arm") {
73    cflags += [ "-DBINDER_IPC_32BIT" ]
74  }
75
76  deps = [
77    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForInstall:pageAbilityBundleForInstall",
78    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForUninstall:pageAbilityBundleForUninstall",
79    "${bundle_framework_path}/test/sceneProject/tools/ohos_test:copy_ohos_test",
80    "//third_party/googletest:gtest_main",
81  ]
82
83  external_deps = [
84    "ability_base:base",
85    "ability_base:configuration",
86    "ability_base:want",
87    "bundle_framework:appexecfwk_core",
88    "bundle_framework:bundle_napi_common",
89    "hilog:libhilog",
90    "ipc:ipc_core",
91    "os_account:os_account_innerkits",
92  ]
93
94  external_deps += bm_install_external_deps
95}
96
97ohos_systemtest("bm_command_dump_system_test") {
98  module_out_path = module_output_path
99
100  sources = [
101    "bm_command_dump_system_test.cpp",
102    "tool_system_test.cpp",
103  ]
104
105  configs = [
106    "${bundletool_path}:tools_bm_config",
107    "${bundletool_test_path}/unittest/bm:tools_bm_config_mock",
108  ]
109
110  cflags = []
111  if (target_cpu == "arm") {
112    cflags += [ "-DBINDER_IPC_32BIT" ]
113  }
114
115  deps = [
116    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForInstall:pageAbilityBundleForInstall",
117    "${bundle_framework_path}/test/sceneProject/tools/bm/pageAbilityBundleForUninstall:pageAbilityBundleForUninstall",
118    "${bundle_framework_path}/test/sceneProject/tools/ohos_test:copy_ohos_test",
119    "//third_party/googletest:gtest_main",
120  ]
121
122  external_deps = [
123    "ability_base:base",
124    "ability_base:configuration",
125    "ability_base:want",
126    "bundle_framework:appexecfwk_core",
127    "bundle_framework:bundle_napi_common",
128    "hilog:libhilog",
129    "ipc:ipc_core",
130    "os_account:os_account_innerkits",
131  ]
132
133  external_deps += bm_install_external_deps
134}
135
136group("systemtest") {
137  testonly = true
138
139  deps = [
140    ":bm_command_dump_system_test",
141    ":bm_command_install_system_test",
142    ":bm_command_uninstall_system_test",
143  ]
144}
145