158ec469eSopenharmony_ci# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
258ec469eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
358ec469eSopenharmony_ci# you may not use this file except in compliance with the License.
458ec469eSopenharmony_ci# You may obtain a copy of the License at
558ec469eSopenharmony_ci#
658ec469eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
758ec469eSopenharmony_ci#
858ec469eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
958ec469eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1058ec469eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1158ec469eSopenharmony_ci# See the License for the specific language governing permissions and
1258ec469eSopenharmony_ci# limitations under the License.
1358ec469eSopenharmony_ci
1458ec469eSopenharmony_ciimport("//build/test.gni")
1558ec469eSopenharmony_ciimport("./../../../../miscdevice.gni")
1658ec469eSopenharmony_ci
1758ec469eSopenharmony_ciohos_unittest("VibratorAgentTest") {
1858ec469eSopenharmony_ci  module_out_path = "sensors/miscdevice/test"
1958ec469eSopenharmony_ci
2058ec469eSopenharmony_ci  sources = [ "vibrator_agent_test.cpp" ]
2158ec469eSopenharmony_ci
2258ec469eSopenharmony_ci  include_dirs = [
2358ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator",
2458ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/utils/common/include",
2558ec469eSopenharmony_ci  ]
2658ec469eSopenharmony_ci
2758ec469eSopenharmony_ci  deps = [
2858ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/frameworks/native/vibrator:vibrator_target",
2958ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/utils/common:libmiscdevice_utils",
3058ec469eSopenharmony_ci  ]
3158ec469eSopenharmony_ci
3258ec469eSopenharmony_ci  external_deps = [
3358ec469eSopenharmony_ci    "access_token:libaccesstoken_sdk",
3458ec469eSopenharmony_ci    "access_token:libnativetoken_shared",
3558ec469eSopenharmony_ci    "access_token:libtokensetproc_shared",
3658ec469eSopenharmony_ci    "c_utils:utils",
3758ec469eSopenharmony_ci    "googletest:gmock",
3858ec469eSopenharmony_ci    "googletest:gtest_main",
3958ec469eSopenharmony_ci    "hilog:libhilog",
4058ec469eSopenharmony_ci    "init:libbegetutil",
4158ec469eSopenharmony_ci    "ipc:ipc_single",
4258ec469eSopenharmony_ci  ]
4358ec469eSopenharmony_ci
4458ec469eSopenharmony_ci  if (miscdevice_feature_vibrator_custom) {
4558ec469eSopenharmony_ci    resource_config_file =
4658ec469eSopenharmony_ci        "$SUBSYSTEM_DIR/test/unittest/vibrator/native/resource/ohos_test.xml"
4758ec469eSopenharmony_ci  }
4858ec469eSopenharmony_ci}
4958ec469eSopenharmony_ci
5058ec469eSopenharmony_cigroup("unittest") {
5158ec469eSopenharmony_ci  testonly = true
5258ec469eSopenharmony_ci  deps = [ ":VibratorAgentTest" ]
5358ec469eSopenharmony_ci}
54