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 "//third_party/googletest/googletest/include", 23 "//third_party/googletest/googletest", 24 "//third_party/protobuf/src", 25 "//third_party/icu/icu4c/source", 26 "//third_party/icu/icu4c/source/common", 27 "//third_party/icu/icu4c/source/i18n", 28 "//third_party/protobuf/src/google", 29 "//third_party/protobuf/src/google/protobuf", 30 ] 31 cflags_cc = [ 32 "-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", 33 "-DI18N_PHONENUMBERS_USE_ICU_REGEXP", 34 "-Dphonenumber_shared_EXPORTS", 35 "-Wall", 36 "-Werror", 37 "-fPIC", 38 "-Wno-sign-compare", 39 "-Wno-error=unused-parameter", 40 "-Wno-error=unused-const-variable", 41 "-Wno-error=unneeded-internal-declaration", 42 ] 43 cflags = [ "-Wno-implicit-fallthrough" ] 44} 45 46ohos_unittest("libphonenumber_test") { 47 module_out_path = module_output_path 48 49 sources = [ 50 "//third_party/googletest/googletest/src/gtest-death-test.cc", 51 "//third_party/googletest/googletest/src/gtest-filepath.cc", 52 "//third_party/googletest/googletest/src/gtest-internal-inl.h", 53 "//third_party/googletest/googletest/src/gtest-port.cc", 54 "//third_party/googletest/googletest/src/gtest-printers.cc", 55 "//third_party/googletest/googletest/src/gtest-test-part.cc", 56 "//third_party/googletest/googletest/src/gtest-typed-test.cc", 57 "//third_party/googletest/googletest/src/gtest.cc", 58 "//third_party/googletest/googletest/src/gtest_main.cc", 59 "//third_party/googletest/googletest/src/hwext/gtest-ext.cc", 60 "//third_party/googletest/googletest/src/hwext/gtest-filter.cc", 61 "//third_party/googletest/googletest/src/hwext/gtest-tag.cc", 62 "//third_party/googletest/googletest/src/hwext/gtest-utils.cc", 63 "//third_party/libphonenumber/cpp/src/phonenumbers/alternate_format.cc", 64 "//third_party/libphonenumber/cpp/src/phonenumbers/asyoutypeformatter.cc", 65 "//third_party/libphonenumber/cpp/src/phonenumbers/base/strings/string_piece.cc", 66 "//third_party/libphonenumber/cpp/src/phonenumbers/default_logger.cc", 67 "//third_party/libphonenumber/cpp/src/phonenumbers/logger.cc", 68 "//third_party/libphonenumber/cpp/src/phonenumbers/phonemetadata.pb.cc", 69 "//third_party/libphonenumber/cpp/src/phonenumbers/phonenumber.cc", 70 "//third_party/libphonenumber/cpp/src/phonenumbers/phonenumber.pb.cc", 71 "//third_party/libphonenumber/cpp/src/phonenumbers/phonenumbermatch.cc", 72 "//third_party/libphonenumber/cpp/src/phonenumbers/phonenumbermatcher.cc", 73 "//third_party/libphonenumber/cpp/src/phonenumbers/phonenumberutil.cc", 74 "//third_party/libphonenumber/cpp/src/phonenumbers/regex_based_matcher.cc", 75 "//third_party/libphonenumber/cpp/src/phonenumbers/regexp_adapter_icu.cc", 76 "//third_party/libphonenumber/cpp/src/phonenumbers/regexp_cache.cc", 77 "//third_party/libphonenumber/cpp/src/phonenumbers/short_metadata.cc", 78 "//third_party/libphonenumber/cpp/src/phonenumbers/shortnumberinfo.cc", 79 "//third_party/libphonenumber/cpp/src/phonenumbers/string_byte_sink.cc", 80 "//third_party/libphonenumber/cpp/src/phonenumbers/stringutil.cc", 81 "//third_party/libphonenumber/cpp/src/phonenumbers/test_metadata.cc", 82 "//third_party/libphonenumber/cpp/src/phonenumbers/unicodestring.cc", 83 "//third_party/libphonenumber/cpp/src/phonenumbers/utf/rune.c", 84 "//third_party/libphonenumber/cpp/src/phonenumbers/utf/unicodetext.cc", 85 "//third_party/libphonenumber/cpp/src/phonenumbers/utf/unilib.cc", 86 "phonenumbers/phonenumberutil_test.cc", 87 "phonenumbers/test_util.cc", 88 ] 89 90 configs = [ ":phonenumber_test_config" ] 91 92 defines = [ 93 "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", 94 "I18N_PHONENUMBERS_USE_ICU_REGEXP", 95 "HAVE_PTHREAD", 96 ] 97 98 deps = [ 99 "//third_party/icu/icu4c:shared_icui18n", 100 "//third_party/icu/icu4c:shared_icuuc", 101 "//third_party/protobuf:protobuf_lite", 102 ] 103} 104