# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/startup/appspawn/appspawn.gni") import("//build/test.gni") if (!defined(ohos_lite)) { ohos_unittest("HnpTest") { module_out_path = "${module_output_path}" cflags = [ "-Wno-implicit-fallthrough", "-Wno-unused-function", "-Dprivate=public", "-Dprotected=public", ] cflags_cc = [ "-Wno-implicit-fallthrough", "-fexceptions", ] include_dirs = [ "${appspawn_path}/service/hnp/base", "${appspawn_path}/service/hnp/pack/include", "${appspawn_path}/service/hnp/installer/include", "${appspawn_path}/interfaces/innerkits/hnp/include", "${appspawn_path}/util/include", ] sources = [ "${appspawn_path}/interfaces/innerkits/hnp/src/hnp_api.c", "${appspawn_path}/service/hnp/base/hnp_file.c", "${appspawn_path}/service/hnp/base/hnp_json.c", "${appspawn_path}/service/hnp/base/hnp_log.c", "${appspawn_path}/service/hnp/base/hnp_sal.c", "${appspawn_path}/service/hnp/base/hnp_zip.c", "${appspawn_path}/service/hnp/installer/src/hnp_installer.c", "${appspawn_path}/service/hnp/pack/src/hnp_pack.c", "hnp_installer_test.cpp", "hnp_pack_test.cpp", ] defines = [ "APPSPAWN_TEST" ] deps = [ "${appspawn_path}/util:libappspawn_util" ] external_deps = [ "bounds_checking_function:libsec_shared", "cJSON:cjson", "code_signature:libcode_sign_utils", "hilog:libhilog", "init:libbegetutil", "selinux_adapter:librestorecon", "zlib:shared_libz", ] } }