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 14import("//build/test.gni") 15 16module_output_path = "libphonenumber/libphonenumber_test" 17 18config("phonenumber_test_config") { 19 include_dirs = [ 20 "//third_party/libphonenumber/cpp/test", 21 "//third_party/libphonenumber/cpp/src", 22 ] 23 cflags_cc = [ 24 "-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", 25 "-DI18N_PHONENUMBERS_USE_ICU_REGEXP", 26 "-Dphonenumber_shared_EXPORTS", 27 "-Wall", 28 "-Werror", 29 "-fPIC", 30 "-Wno-sign-compare", 31 "-Wno-error=unused-parameter", 32 "-Wno-error=unused-const-variable", 33 "-Wno-error=unneeded-internal-declaration", 34 ] 35 cflags = [ "-Wno-implicit-fallthrough" ] 36} 37 38ohos_unittest("libphonenumber_test") { 39 module_out_path = module_output_path 40 41 sources = [ 42 "phonenumbers/phonenumberutil_test.cc", 43 "phonenumbers/test_util.cc", 44 ] 45 46 configs = [ ":phonenumber_test_config" ] 47 48 defines = [ 49 "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", 50 "I18N_PHONENUMBERS_USE_ICU_REGEXP", 51 "HAVE_PTHREAD", 52 ] 53 54 deps = [ "//third_party/libphonenumber/cpp:phonenumber_standard" ] 55 external_deps = [ 56 "googletest:gtest", 57 "icu:shared_icui18n", 58 "icu:shared_icuuc", 59 "protobuf:protobuf_lite", 60 ] 61} 62