1cf69771bSopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd.
2cf69771bSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3cf69771bSopenharmony_ci# you may not use this file except in compliance with the License.
4cf69771bSopenharmony_ci# You may obtain a copy of the License at
5cf69771bSopenharmony_ci#
6cf69771bSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7cf69771bSopenharmony_ci#
8cf69771bSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9cf69771bSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10cf69771bSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11cf69771bSopenharmony_ci# See the License for the specific language governing permissions and
12cf69771bSopenharmony_ci# limitations under the License.
13cf69771bSopenharmony_ci
14cf69771bSopenharmony_ciimport("//build/test.gni")
15cf69771bSopenharmony_ciimport("../../../time.gni")
16cf69771bSopenharmony_ci
17cf69771bSopenharmony_ciohos_unittest("TimeServiceNativeTest") {
18cf69771bSopenharmony_ci  module_out_path = "time_service/native"
19cf69771bSopenharmony_ci
20cf69771bSopenharmony_ci  visibility = [ ":*" ]
21cf69771bSopenharmony_ci
22cf69771bSopenharmony_ci  include_dirs = [ "../../../interfaces/kits/c/include" ]
23cf69771bSopenharmony_ci
24cf69771bSopenharmony_ci  sources = [ "time_service_native_test.cpp" ]
25cf69771bSopenharmony_ci
26cf69771bSopenharmony_ci  cflags = [ "-fvisibility=hidden" ]
27cf69771bSopenharmony_ci  cflags_cc = [ "-fvisibility-inlines-hidden" ]
28cf69771bSopenharmony_ci
29cf69771bSopenharmony_ci  deps = [
30cf69771bSopenharmony_ci    "${time_capi_path}:time_service_ndk",
31cf69771bSopenharmony_ci    "//third_party/googletest:gtest_main",
32cf69771bSopenharmony_ci  ]
33cf69771bSopenharmony_ci  branch_protector_ret = "pac_ret"
34cf69771bSopenharmony_ci  sanitize = {
35cf69771bSopenharmony_ci    cfi = true
36cf69771bSopenharmony_ci    cfi_cross_dso = true
37cf69771bSopenharmony_ci    debug = false
38cf69771bSopenharmony_ci  }
39cf69771bSopenharmony_ci  external_deps = [
40cf69771bSopenharmony_ci    "hilog:libhilog",
41cf69771bSopenharmony_ci    "init:libbegetutil",
42cf69771bSopenharmony_ci  ]
43cf69771bSopenharmony_ci}
44cf69771bSopenharmony_ci
45cf69771bSopenharmony_cigroup("unittest") {
46cf69771bSopenharmony_ci  testonly = true
47cf69771bSopenharmony_ci
48cf69771bSopenharmony_ci  deps = [ ":TimeServiceNativeTest" ]
49cf69771bSopenharmony_ci}
50