1# Copyright (c) 2024 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("DevicedebugTest") {
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/devicedebug/base",
33      "${appspawn_path}/service/devicedebug/kill/include",
34      "${appspawn_path}/test/unittest/devicedebug_test",
35    ]
36
37    sources = [
38      "${appspawn_path}/service/devicedebug/kill/src/devicedebug_kill.c",
39      "${appspawn_path}/test/unittest/devicedebug_test/devicedebug_stub.c",
40      "devicedebug_kill_test.cpp",
41    ]
42
43    defines = [
44      "IsDeveloperModeOpen=IsDeveloperModeOpenStub",
45      "AppSpawnClientInit=AppSpawnClientInitStub",
46      "AppSpawnReqMsgCreate=AppSpawnReqMsgCreateStub",
47      "AppSpawnReqMsgAddExtInfo=AppSpawnReqMsgAddExtInfoStub",
48      "AppSpawnClientSendMsg=AppSpawnClientSendMsgStub",
49      "APPSPAWN_TEST",
50    ]
51
52    external_deps = [
53      "cJSON:cjson",
54      "hilog:libhilog",
55    ]
56
57    deps = [
58      "${appspawn_path}/interfaces/innerkits/client:appspawn_client",
59      "${appspawn_path}/service/devicedebug:devicedebug",
60      "${appspawn_path}/util:libappspawn_util",
61    ]
62  }
63}
64