• 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")
15import("../../base/config.gni")
16
17module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device"
18config("module_private_config") {
19  visibility = [ ":*" ]
20  if (current_toolchain != host_toolchain) {
21    defines = [ "HAVE_HILOG" ]
22  }
23}
24
25ohos_unittest("hiprofiler_base_ut") {
26  module_out_path = module_output_path
27  deps = [
28    "../:hiprofiler_base",
29    "//third_party/googletest:gtest",
30  ]
31  configs = [ ":module_private_config" ]
32  include_dirs = [ "//third_party/googletest/googletest/include/gtest" ]
33  sources = [
34    "unittest/epoll_event_poller_test.cpp",
35    "unittest/schedule_task_manager_test.cpp",
36    "unittest/semaphore_test.cpp",
37  ]
38  cflags = [
39    "-Wno-inconsistent-missing-override",
40    "-Dprivate=public",  #allow test code access private members
41  ]
42  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
43  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
44}
45
46group("unittest") {
47  testonly = true
48  deps = [ ":hiprofiler_base_ut" ]
49}
50