# Copyright (c) 2024 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") ohos_unittest("AppSpawn_client_ut") { module_out_path = "${module_output_path}" deps = [] defines = [ "APPSPAWN_BASE_DIR=\"/data/appspawn_ut\"", "APPSPAWN_TEST", "APPSPAWN_CLIENT", "OHOS_DEBUG", "USER_TIMER_TO_CHECK", "APPSPAWN_LABEL=\"APPSPAWN_CLENT_UT\"", ] include_dirs = [ "${appspawn_path}", "${appspawn_path}/common", "${appspawn_path}/standard", "${appspawn_path}/modules/modulemgr", "${appspawn_path}/modules/ace_adapter", "${appspawn_path}/modules/common", "${appspawn_path}/modules/sandbox", "${appspawn_path}/modules/module_engine/include", "${appspawn_path}/modules/sysevent", "${appspawn_innerkits_path}/client", "${appspawn_innerkits_path}/include", "${appspawn_innerkits_path}/permission", "${appspawn_path}/util/include", "${appspawn_path}/test/unittest", "${appspawn_path}/test/mock", ] # client sources = [ "${appspawn_innerkits_path}/client/appspawn_client.c", "${appspawn_innerkits_path}/client/appspawn_msg.c", "${appspawn_innerkits_path}/permission/appspawn_mount_permission.c", "${appspawn_path}/modules/sandbox/appspawn_permission.c", ] # server sources += [ "${appspawn_path}/common/appspawn_server.c", "${appspawn_path}/common/appspawn_trace.cpp", "${appspawn_path}/modules/common/appspawn_dfx_dump.cpp", "${appspawn_path}/modules/modulemgr/appspawn_modulemgr.c", "${appspawn_path}/standard/appspawn_appmgr.c", "${appspawn_path}/standard/appspawn_msgmgr.c", "${appspawn_path}/standard/appspawn_service.c", "${appspawn_path}/standard/nwebspawn_launcher.c", "${appspawn_path}/util/src/appspawn_utils.c", ] sources += [ "${appspawn_path}/test/unittest/app_spawn_client_test/app_spawn_client_test.cpp", "${appspawn_path}/test/unittest/app_spawn_client_test/app_spawn_interface_test.cpp", "${appspawn_path}/test/unittest/app_spawn_test_helper.cpp", ] if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) { defines += [ "APPSPAWN_SANDBOX_NEW" ] } if (asan_detector || is_asan) { defines += [ "ASAN_DETECTOR" ] } external_deps = [ "cJSON:cjson", "c_utils:utils", "config_policy:configpolicy_util", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", ] if (enable_appspawn_dump_catcher) { external_deps += [ "faultloggerd:libdfx_dumpcatcher" ] } if (appspawn_report_event) { external_deps += [ "hisysevent:libhisysevent" ] sources += [ "${appspawn_path}/modules/sysevent/appspawn_hisysevent.cpp" ] } if (build_selinux) { defines += [ "WITH_SELINUX" ] external_deps += [ "selinux:libselinux", "selinux_adapter:libhap_restorecon", ] } }