1# Copyright (c) 2023 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/ohos.gni")
15import("//build/test.gni")
16import("//foundation/communication/netstack/netstack_config.gni")
17
18#SOCKET_NAPI = "$NETSTACK_DIR/frameworks/js/napi/socket"
19WEBSOCKET_INNERAPI = "$NETSTACK_DIR/frameworks/native/websocket_client"
20
21utils_include = [
22  "$SUBSYSTEM_DIR/netstack/utils/common_utils/include",
23  "$SUBSYSTEM_DIR/netstack/utils/log/include",
24  "$SUBSYSTEM_DIR/netstack/utils/napi_utils/include",
25  "$THIRD_PARTY_ROOT/libwebsockets/include",
26]
27
28common_external_deps = [
29  "hilog:libhilog",
30  "napi:ace_napi",
31]
32
33ohos_unittest("websocket_inner_unittest") {
34  module_out_path = "netstack/websocket_inner_unittest"
35
36  include_dirs = [
37    "$NETSTACK_DIR/utils/napi_utils/include",
38    "$WEBSOCKET_INNERAPI/include",
39  ]
40  include_dirs += utils_include
41
42  sources = [ "websocket_inner_unittest.cpp" ]
43
44  deps = [
45    "$NETSTACK_DIR/utils/napi_utils:napi_utils",
46    "$NETSTACK_INNERKITS_DIR/websocket_client:websocket_client",
47  ]
48
49  external_deps = common_external_deps
50
51  part_name = "netstack"
52  subsystem_name = "communication"
53}
54
55group("unittest") {
56  testonly = true
57  deps = [ ":websocket_inner_unittest" ]
58}
59