1# Copyright (c) 2020-2021 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/startup/init/begetd.gni") 15import("//build/ohos.gni") 16import("//build/test.gni") 17 18ohos_shared_library("libparamtestmodule") { 19 sources = [ "param_test_module.c" ] 20 21 include_dirs = [ 22 "//base/startup/init/interfaces/innerkits/include/param", 23 "//base/startup/init/interfaces/innerkits/include", 24 "//base/startup/init/services/init/include", 25 "//base/startup/init/services/log", 26 "//base/startup/init/services/loopevent/include", 27 "//base/startup/init/services/param/include", 28 "//base/startup/init/ueventd/include", 29 ] 30 31 deps = [ 32 "//base/startup/init/interfaces/innerkits:libbegetutil", 33 "//base/startup/init/interfaces/innerkits/init_module_engine:libinit_module_engine", 34 "//base/startup/init/services/log:agent_log", 35 ] 36 external_deps = [ 37 "bounds_checking_function:libsec_shared", 38 "cJSON:cjson", 39 ] 40 41 part_name = "init" 42 subsystem_name = "startup" 43 module_install_dir = "lib/init" 44} 45 46ohos_moduletest("InitModuleTest") { 47 module_out_path = "init/init" 48 49 sources = [ 50 "hookmgr_moduletest.cpp", 51 "modulemgr_moduletest.cpp", 52 "service_control_test.cpp", 53 "service_watcher_moduleTest.cpp", 54 "syspara_moduleTest.cpp", 55 "test_utils.cpp", 56 ] 57 defines = [] 58 59 if (enable_ohos_startup_init_feature_deviceinfo) { 60 sources += [ "deviceinfo_moduleTest.cpp" ] 61 62 if (init_get_disk_sn) { 63 defines += [ "PARAM_FEATURE_GET_DEVICE_SN" ] 64 } 65 } 66 67 include_dirs = [ 68 "//base/startup/init/interfaces/innerkits/include", 69 "//base/startup/init/interfaces/innerkits/include/syspara", 70 "//base/startup/init/interfaces/innerkits/syspara", 71 "//base/startup/init/interfaces/innerkits/include/param", 72 "//base/startup/init/services/param/include", 73 ".", 74 ] 75 76 deps = [ 77 "//base/startup/init/interfaces/innerkits:deviceinfo_proxy", 78 "//base/startup/init/interfaces/innerkits:libbeget_proxy", 79 "//base/startup/init/interfaces/innerkits:libbegetutil", 80 ] 81 82 external_deps = [ 83 "bounds_checking_function:libsec_shared", 84 "c_utils:utils", 85 "googletest:gtest_main", 86 "hilog:libhilog_base", 87 "ipc:ipc_single", 88 "samgr:samgr_proxy", 89 ] 90} 91 92group("moduletest") { 93 testonly = true 94 deps = [ ":InitModuleTest" ] 95} 96 97group("paramtestmodule") { 98 if (param_test) { 99 deps = [ ":libparamtestmodule" ] 100 } 101} 102