• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "//base/startup/init/device_info",
30  ]
31
32  deps = [
33    "//base/startup/init/interfaces/innerkits:libbegetutil",
34    "//base/startup/init/interfaces/innerkits/init_module_engine:libinit_module_engine",
35    "//base/startup/init/services/log:agent_log",
36  ]
37  external_deps = [
38    "bounds_checking_function:libsec_shared",
39    "cJSON:cjson",
40  ]
41
42  part_name = "init"
43  subsystem_name = "startup"
44  module_install_dir = "lib/init"
45}
46
47ohos_moduletest("InitModuleTest") {
48  module_out_path = "startup/init"
49
50  sources = [
51    "hookmgr_moduletest.cpp",
52    "modulemgr_moduletest.cpp",
53    "service_control_test.cpp",
54    "service_watcher_moduleTest.cpp",
55    "syspara_moduleTest.cpp",
56    "test_utils.cpp",
57  ]
58  defines = []
59
60  if (enable_ohos_startup_init_feature_deviceinfo) {
61    sources += [ "deviceinfo_moduleTest.cpp" ]
62
63    if (init_get_disk_sn) {
64      defines += [ "PARAM_FEATURE_GET_DEVICE_SN" ]
65    }
66  }
67
68  include_dirs = [
69    "//base/startup/init/interfaces/innerkits/include",
70    "//base/startup/init/interfaces/innerkits/include/syspara",
71    "//base/startup/init/interfaces/innerkits/syspara",
72    "//base/startup/init/interfaces/innerkits/include/param",
73    "//base/startup/init/services/param/include",
74    "//base/startup/init/device_info",
75    ".",
76  ]
77
78  deps = [
79    "//base/startup/init/interfaces/innerkits:libbeget_proxy",
80    "//base/startup/init/interfaces/innerkits:libbegetutil",
81    "//third_party/googletest:gtest_main",
82  ]
83
84  external_deps = [
85    "bounds_checking_function:libsec_shared",
86    "c_utils:utils",
87    "hilog:libhilog_base",
88    "ipc:ipc_single",
89    "samgr:samgr_proxy",
90  ]
91}
92
93group("moduletest") {
94  testonly = true
95  deps = [ ":InitModuleTest" ]
96}
97
98group("paramtestmodule") {
99  if (param_test) {
100    deps = [ ":libparamtestmodule" ]
101  }
102}
103