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