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("//arkcompiler/toolchain/test/test_helper.gni") 15import("//arkcompiler/toolchain/toolchain.gni") 16 17module_output_path = "arkcompiler/toolchain" 18 19host_unittest_action("WebSocketTest") { 20 module_out_path = module_output_path 21 22 include_dirs = [ "$toolchain_root/websocket" ] 23 24 sources = [ 25 # test file 26 "../../common/log_wrapper.cpp", 27 "frame_builder_test.cpp", 28 "http_decoder_test.cpp", 29 "web_socket_frame_test.cpp", 30 "websocket_test.cpp", 31 ] 32 33 configs = [ "$toolchain_root:toolchain_test_config" ] 34 35 deps = [ 36 "$toolchain_root/websocket:websocket_client", 37 "$toolchain_root/websocket:websocket_server", 38 ] 39 40 # hiviewdfx libraries 41 external_deps = hiviewdfx_ext_deps 42 if (is_arkui_x && target_os == "ios") { 43 external_deps += [ "openssl:libcrypto_static" ] 44 } else { 45 external_deps += [ "openssl:libcrypto_shared" ] 46 } 47 48 external_deps += [ "bounds_checking_function:libsec_shared" ] 49 deps += hiviewdfx_deps 50} 51 52group("unittest") { 53 testonly = true 54 55 # deps file 56 deps = [ ":WebSocketTest" ] 57 58 if (is_mac) { 59 deps -= [ ":WebSocketTest" ] 60 } 61} 62 63group("host_unittest") { 64 testonly = true 65 66 # deps file 67 deps = [ ":WebSocketTestAction" ] 68 69 if (is_mac) { 70 deps -= [ ":WebSocketTestAction" ] 71 } 72} 73