• 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/lite/config/component/lite_component.gni")
15import("//build/lite/config/test.gni")
16
17hitrace_root_dir = "//base/hiviewdfx/hitrace"
18hitrace_code_dir = "${hitrace_root_dir}/frameworks/native"
19hitrace_test_dir = "${hitrace_root_dir}/test/unittest"
20
21config("module_private_config") {
22  visibility = [ ":*" ]
23  include_dirs = [
24    "//base/hiviewdfx/hitrace/interfaces/native/innerkits/include",
25    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
26    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
27    "//third_party/bounds_checking_function/include",
28  ]
29}
30
31unittest("HitraceCTest") {
32  sources = [
33    "${hitrace_code_dir}/hitracec.c",
34    "${hitrace_test_dir}/common/native/hitracec_test.cpp",
35  ]
36
37  configs = [ ":module_private_config" ]
38
39  public_deps = [
40    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
41    "//third_party/bounds_checking_function:libsec_shared",
42  ]
43}
44
45unittest("HitraceCppTest") {
46  sources = [
47    "${hitrace_code_dir}/hitrace.cpp",
48    "${hitrace_code_dir}/hitracec.c",
49    "${hitrace_code_dir}/hitraceid.cpp",
50    "${hitrace_test_dir}/common/native/hitracecpp_test.cpp",
51  ]
52
53  configs = [ ":module_private_config" ]
54
55  public_deps = [
56    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
57    "//third_party/bounds_checking_function:libsec_shared",
58  ]
59}
60
61group("unittest") {
62  if (ohos_build_type == "debug") {
63    deps = [
64      ":HitraceCTest",
65      ":HitraceCppTest",
66    ]
67  }
68}
69