1# Copyright (c) 2022 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 14import("//build/test.gni") 15 16config("nfc_service_unit_test_config") { 17 visibility = [ ":*" ] 18 19 include_dirs = [ 20 "//foundation/communication/nfc/interfaces/inner_api/include", 21 "//foundation/communication/nfc/interfaces/inner_api/include/controller", 22 "//foundation/communication/nfc/interfaces/inner_api/include/tags", 23 "//foundation/communication/nfc/interfaces/inner_api/include/cardEmulation", 24 ] 25 26 defines = [] 27 cflags_cc = [] 28 ldflags = [] 29 libs = [] 30} 31 32unit_test_deps = [ 33 "//foundation/communication/nfc/interfaces/inner_api:nfc_inner_kits", 34 "//third_party/googletest:gtest_main", 35] 36 37unit_test_external_deps = [ 38 "ability_base:want", 39 "c_utils:utils", 40 "hiviewdfx_hilog_native:libhilog", 41 "ipc:ipc_core", 42 "safwk:system_ability_fwk", 43 "samgr:samgr_proxy", 44 "samgr:samgr_proxy", 45] 46 47ohos_unittest("controller_test") { 48 module_out_path = "nfc/services" 49 50 sources = [ "controller_test/nfc_controller_test.cpp" ] 51 52 configs = [ ":nfc_service_unit_test_config" ] 53 54 deps = unit_test_deps 55 56 external_deps = unit_test_external_deps 57 58 part_name = "nfc" 59 subsystem_name = "communication" 60} 61 62ohos_unittest("cardemulation_test") { 63 module_out_path = "nfc/services" 64 65 sources = [ "cardemulation_test/cardemulation_test.cpp" ] 66 67 configs = [ ":nfc_service_unit_test_config" ] 68 69 deps = unit_test_deps 70 71 external_deps = unit_test_external_deps 72 73 part_name = "nfc" 74 subsystem_name = "communication" 75} 76 77ohos_unittest("tags_test") { 78 module_out_path = "nfc/services" 79 80 sources = [ 81 "tags_test/iso15693_tag_test.cpp", 82 "tags_test/isodep_tag_test.cpp", 83 "tags_test/mifare_classic_tag_test.cpp", 84 "tags_test/ndef_tag_test.cpp", 85 "tags_test/nfca_tag_test.cpp", 86 "tags_test/nfcb_tag_test.cpp", 87 "tags_test/nfcf_tag_test.cpp", 88 "tags_test/tag_info_test.cpp", 89 ] 90 91 configs = [ ":nfc_service_unit_test_config" ] 92 93 deps = unit_test_deps 94 95 external_deps = unit_test_external_deps 96 97 part_name = "nfc" 98 subsystem_name = "communication" 99} 100 101group("nfc_service_unittest") { 102 testonly = true 103 deps = [ 104 ":cardemulation_test", 105 ":controller_test", 106 ":tags_test", 107 ] 108} 109