1# Copyright (c) 2021-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.
13import("//base/startup/appspawn/appspawn.gni")
14import("//build/test.gni")
15
16if (!defined(ohos_lite)) {
17  ohos_unittest("HnpTest") {
18    module_out_path = "${module_output_path}"
19    cflags = [
20      "-Wno-implicit-fallthrough",
21      "-Wno-unused-function",
22      "-Dprivate=public",
23      "-Dprotected=public",
24    ]
25
26    cflags_cc = [
27      "-Wno-implicit-fallthrough",
28      "-fexceptions",
29    ]
30
31    include_dirs = [
32      "${appspawn_path}/service/hnp/base",
33      "${appspawn_path}/service/hnp/pack/include",
34      "${appspawn_path}/service/hnp/installer/include",
35      "${appspawn_path}/interfaces/innerkits/hnp/include",
36      "${appspawn_path}/util/include",
37    ]
38
39    sources = [
40      "${appspawn_path}/interfaces/innerkits/hnp/src/hnp_api.c",
41      "${appspawn_path}/service/hnp/base/hnp_file.c",
42      "${appspawn_path}/service/hnp/base/hnp_json.c",
43      "${appspawn_path}/service/hnp/base/hnp_log.c",
44      "${appspawn_path}/service/hnp/base/hnp_sal.c",
45      "${appspawn_path}/service/hnp/base/hnp_zip.c",
46      "${appspawn_path}/service/hnp/installer/src/hnp_installer.c",
47      "${appspawn_path}/service/hnp/pack/src/hnp_pack.c",
48      "hnp_installer_test.cpp",
49      "hnp_pack_test.cpp",
50    ]
51
52    defines = [ "APPSPAWN_TEST" ]
53
54    deps = [ "${appspawn_path}/util:libappspawn_util" ]
55
56    external_deps = [
57      "bounds_checking_function:libsec_shared",
58      "cJSON:cjson",
59      "code_signature:libcode_sign_utils",
60      "hilog:libhilog",
61      "init:libbegetutil",
62      "selinux_adapter:librestorecon",
63      "zlib:shared_libz",
64    ]
65  }
66}
67