169570cc8Sopenharmony_ci# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
269570cc8Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
369570cc8Sopenharmony_ci# you may not use this file except in compliance with the License.
469570cc8Sopenharmony_ci# You may obtain a copy of the License at
569570cc8Sopenharmony_ci#
669570cc8Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
769570cc8Sopenharmony_ci#
869570cc8Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
969570cc8Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1069570cc8Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1169570cc8Sopenharmony_ci# See the License for the specific language governing permissions and
1269570cc8Sopenharmony_ci# limitations under the License.
1369570cc8Sopenharmony_ciimport("//base/startup/appspawn/appspawn.gni")
1469570cc8Sopenharmony_ciimport("//build/test.gni")
1569570cc8Sopenharmony_ci
1669570cc8Sopenharmony_ciif (!defined(ohos_lite)) {
1769570cc8Sopenharmony_ci  ohos_unittest("DevicedebugTest") {
1869570cc8Sopenharmony_ci    module_out_path = "${module_output_path}"
1969570cc8Sopenharmony_ci    cflags = [
2069570cc8Sopenharmony_ci      "-Wno-implicit-fallthrough",
2169570cc8Sopenharmony_ci      "-Wno-unused-function",
2269570cc8Sopenharmony_ci      "-Dprivate=public",
2369570cc8Sopenharmony_ci      "-Dprotected=public",
2469570cc8Sopenharmony_ci    ]
2569570cc8Sopenharmony_ci
2669570cc8Sopenharmony_ci    cflags_cc = [
2769570cc8Sopenharmony_ci      "-Wno-implicit-fallthrough",
2869570cc8Sopenharmony_ci      "-fexceptions",
2969570cc8Sopenharmony_ci    ]
3069570cc8Sopenharmony_ci
3169570cc8Sopenharmony_ci    include_dirs = [
3269570cc8Sopenharmony_ci      "${appspawn_path}/service/devicedebug/base",
3369570cc8Sopenharmony_ci      "${appspawn_path}/service/devicedebug/kill/include",
3469570cc8Sopenharmony_ci      "${appspawn_path}/test/unittest/devicedebug_test",
3569570cc8Sopenharmony_ci    ]
3669570cc8Sopenharmony_ci
3769570cc8Sopenharmony_ci    sources = [
3869570cc8Sopenharmony_ci      "${appspawn_path}/service/devicedebug/kill/src/devicedebug_kill.c",
3969570cc8Sopenharmony_ci      "${appspawn_path}/test/unittest/devicedebug_test/devicedebug_stub.c",
4069570cc8Sopenharmony_ci      "devicedebug_kill_test.cpp",
4169570cc8Sopenharmony_ci    ]
4269570cc8Sopenharmony_ci
4369570cc8Sopenharmony_ci    defines = [
4469570cc8Sopenharmony_ci      "IsDeveloperModeOpen=IsDeveloperModeOpenStub",
4569570cc8Sopenharmony_ci      "AppSpawnClientInit=AppSpawnClientInitStub",
4669570cc8Sopenharmony_ci      "AppSpawnReqMsgCreate=AppSpawnReqMsgCreateStub",
4769570cc8Sopenharmony_ci      "AppSpawnReqMsgAddExtInfo=AppSpawnReqMsgAddExtInfoStub",
4869570cc8Sopenharmony_ci      "AppSpawnClientSendMsg=AppSpawnClientSendMsgStub",
4969570cc8Sopenharmony_ci      "APPSPAWN_TEST",
5069570cc8Sopenharmony_ci    ]
5169570cc8Sopenharmony_ci
5269570cc8Sopenharmony_ci    external_deps = [
5369570cc8Sopenharmony_ci      "cJSON:cjson",
5469570cc8Sopenharmony_ci      "hilog:libhilog",
5569570cc8Sopenharmony_ci    ]
5669570cc8Sopenharmony_ci
5769570cc8Sopenharmony_ci    deps = [
5869570cc8Sopenharmony_ci      "${appspawn_path}/interfaces/innerkits/client:appspawn_client",
5969570cc8Sopenharmony_ci      "${appspawn_path}/service/devicedebug:devicedebug",
6069570cc8Sopenharmony_ci      "${appspawn_path}/util:libappspawn_util",
6169570cc8Sopenharmony_ci    ]
6269570cc8Sopenharmony_ci  }
6369570cc8Sopenharmony_ci}
64