1# Copyright (c) 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 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16 import("//build/lite/config/test.gni") 17} else { 18 import("//build/ohos.gni") 19 import("//build/test.gni") 20 import("//drivers/adapter/uhdf2/uhdf.gni") 21} 22 23if (defined(ohos_lite)) { 24 unittest("hdf_peripheral_misc_test_vibrator_performance") { 25 output_extension = "bin" 26 output_dir = "$root_out_dir/test/unittest/hdf" 27 include_dirs = [ 28 "//third_party/bounds_checking_function/include", 29 "//drivers/framework/ability/sbuf/include", 30 "//drivers/framework/include/platform", 31 "//drivers/framework/include/core", 32 "//drivers/framework/include/osal", 33 "//drivers/framework/include/utils", 34 "//drivers/peripheral/misc/vibrator/interfaces/include", 35 "//drivers/adapter/uhdf/posix/include", 36 "//drivers/framework/test/unittest/include", 37 ] 38 39 sources = [ "./common/hdf_vibrator_performance_test.cpp" ] 40 cflags = [ 41 "-Wall", 42 "-Wextra", 43 "-Werror", 44 "-fsigned-char", 45 "-fno-common", 46 "-fno-strict-aliasing", 47 ] 48 deps = [ 49 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 50 "//drivers/adapter/uhdf/manager:hdf_core", 51 "//drivers/adapter/uhdf/posix:hdf_posix_osal", 52 "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", 53 "//drivers/peripheral/misc/vibrator/hal:hdi_vibrator", 54 ] 55 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 56 } 57} else { 58 module_output_path = "hdf/misc" 59 ohos_unittest("hdf_peripheral_misc_test_vibrator_performance") { 60 module_out_path = module_output_path 61 include_dirs = [] 62 63 sources = [ "./common/hdf_vibrator_performance_test.cpp" ] 64 cflags = [ 65 "-Wall", 66 "-Wextra", 67 "-Werror", 68 "-fsigned-char", 69 "-fno-common", 70 "-fno-strict-aliasing", 71 ] 72 deps = [ 73 "$hdf_uhdf_path/osal:libhdf_utils", 74 "//drivers/peripheral/misc/vibrator/hal:hdi_vibrator", 75 "//utils/native/base:utils", 76 ] 77 if (is_standard_system) { 78 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 79 } else { 80 external_deps = [ "hilog:libhilog" ] 81 } 82 } 83} 84