• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//base/global/i18n/i18n.gni")
15import("//build/test.gni")
16
17module_output_path = "i18n/intl_test"
18
19ohos_unittest("intl_test") {
20  module_out_path = module_output_path
21
22  cflags_cc = [ "-Wno-inconsistent-missing-override" ]
23
24  sources = [
25    "unittest/convert_test.cpp",
26    "unittest/i18n_test.cpp",
27    "unittest/intl_test.cpp",
28    "unittest/intl_test_extent.cpp",
29    "unittest/locale_config_test.cpp",
30    "unittest/mock/src/generate_ics_file.cpp",
31    "unittest/mock/src/i18n_timezone_mock.cpp",
32    "unittest/mock/src/phone_number_format_mock.cpp",
33    "unittest/number_format_test.cpp",
34    "unittest/number_format_test_extend.cpp",
35    "unittest/phone_number_format_test.cpp",
36    "unittest/translit_test.cpp",
37  ]
38  include_dirs = [
39    "//base/global/i18n/frameworks/intl/entity_recognition/include",
40    "//base/global/i18n/frameworks/intl/entity_recognition/phone_number_recognition/include",
41    "//base/global/i18n/frameworks/intl/entity_recognition/date_time_recognition/include",
42    "//base/global/i18n/frameworks/intl/include",
43    "//base/global/i18n/frameworks/intl/parameter_upgrade/include",
44    "//base/global/i18n/frameworks/intl/test/unittest/mock/include",
45    "//base/global/i18n/interfaces/native/inner_api/i18n/include",
46    "//base/global/i18n/interfaces/native/inner_api/preferred_language/include",
47    "//base/global/i18n/services/include",
48  ]
49
50  external_deps = [
51    "access_token:libaccesstoken_sdk",
52    "access_token:libnativetoken",
53    "access_token:libtoken_setproc",
54    "c_utils:utils",
55    "googletest:gmock",
56    "googletest:gtest",
57    "icu:shared_icui18n",
58    "icu:shared_icuuc",
59    "init:libbegetutil",
60    "ipc:ipc_core",
61    "libphonenumber:phonenumber_standard",
62    "libpng:libpng",
63    "libxml2:libxml2",
64    "openssl:libssl_shared",
65    "preferences:native_preferences",
66  ]
67  defines = []
68  if (i18n_support_app_preferred_language) {
69    defines += [ "SUPPORT_APP_PREFERRED_LANGUAGE" ]
70  }
71  if (target_platform == "pc") {
72    defines += [ "SUPPORT_MULTI_USER" ]
73  }
74
75  deps = [
76    "//base/global/i18n/frameworks/intl:build_module",
77    "//base/global/i18n/services:i18n_sa_client",
78  ]
79}
80
81group("unittest") {
82  testonly = true
83  deps = [ ":intl_test" ]
84}
85