• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2025 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("//foundation/communication/bluetooth/bluetooth.gni")
16
17module_output_path = "bluetooth/bluetooth"
18FRAMWORK_DIR = "//foundation/communication/bluetooth"
19
20config("module_private_config") {
21    cflags = [
22        "-Werror",
23        "-Wno-macro-redefined",
24        "-Wno-non-c-typedef-for-linkage",
25        "-Wno-unused-const-variable",
26        "-Wno-deprecated-builtins",
27        "-Wno-defaulted-function-deleted",
28        "-Woverloaded-virtual",
29    ]
30    include_dirs = [
31        ".",
32        "$FRAMWORK_DIR/frameworks/inner/include",
33        "$FRAMWORK_DIR/frameworks/js/napi/include",
34        "$FRAMWORK_DIR/frameworks/js/napi/src/parser",
35        "$FRAMWORK_DIR/interfaces/inner_api/include",
36        "$FRAMWORK_DIR/interfaces/inner_api/include/c_header",
37    ]
38    defines = [
39        "BTFW_LOG_TAG = \"bluetooth_test\"",
40        "BTFW_LOG_DOMAIN = 0xD005300",
41        "private = public",
42        "protected = public",
43    ]
44}
45
46ohos_unittest("bluetooth_napi_event_subscribe_module_test") {
47    module_out_path = module_output_path
48
49    sources = [
50        "$FRAMWORK_DIR/frameworks/js/napi/src/common/napi_event_subscribe_module.cpp",
51        "napi_event_subscribe_module_test.cpp",
52    ]
53
54    configs = [
55        ":module_private_config",
56    ]
57
58    external_deps = [
59        "c_utils:utils",
60        "hilog:libhilog",
61        "googletest:gmock_main",
62        "googletest:gtest_main",
63    ]
64}
65
66################################################################################
67group("unittest") {
68    testonly = true
69
70    deps = []
71
72    if (is_phone_product) {
73        deps += [
74            ":bluetooth_napi_event_subscribe_module_test",
75        ]
76    }
77}