# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") NFC_DIR = "../../" config("hdf_nfc_unit_test_config") { visibility = [ ":*" ] include_dirs = [ "$NFC_DIR/hdi_service", "$NFC_DIR/vendor_adaptor", "$NFC_DIR/test/unittest/mock", ] cflags_cc = [ "-fexceptions" ] cflags = [ "--coverage" ] ldflags = [ "--coverage" ] } unit_test_deps = [ "$NFC_DIR/hdi_service:libnfc_interface_service_1.1", "$NFC_DIR/vendor_adaptor:nfc_vendor_adaptor", ] unit_test_external_deps = [ "c_utils:utils", "drivers_interface_nfc:libnfc_stub_1.1", "drivers_interface_nfc:nfc_idl_headers", "hdf_core:libhdf_host", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_single", ] test_out_path = "drivers_peripheral_nfc/drivers_peripheral_nfc" ohos_unittest("nfc_impl_test") { module_out_path = test_out_path sources = [ "$NFC_DIR/test/unittest/mock/mock.cpp", "nfc_impl_test/nfc_impl_test.cpp", ] configs = [ ":hdf_nfc_unit_test_config" ] deps = unit_test_deps external_deps = unit_test_external_deps part_name = "drivers_peripheral_nfc" subsystem_name = "hdf" } ohos_unittest("nfc_impl_mock_test") { module_out_path = test_out_path sources = [ "nfc_impl_mock_test/nfc_impl_mock_test.cpp" ] configs = [ ":hdf_nfc_unit_test_config" ] deps = unit_test_deps external_deps = unit_test_external_deps part_name = "drivers_peripheral_nfc" subsystem_name = "hdf" } ohos_unittest("nfc_vendor_adaptions_test") { module_out_path = test_out_path sources = [ "nfc_vendor_adaptions_test/nfc_vendor_adaptions_test.cpp" ] configs = [ ":hdf_nfc_unit_test_config" ] deps = unit_test_deps external_deps = unit_test_external_deps part_name = "drivers_peripheral_nfc" subsystem_name = "hdf" } group("hdf_nfc_unittest") { testonly = true deps = [ ":nfc_impl_mock_test", ":nfc_impl_test", ":nfc_vendor_adaptions_test", ] }