• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2022 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
14include_directories(../../../frameworks/js/napi/fetch/fetch_module/include)
15include_directories(../../../frameworks/js/napi/fetch/async_work/include)
16include_directories(../../../frameworks/js/napi/fetch/fetch_exec/include)
17include_directories(../../../frameworks/js/napi/fetch/constant/include)
18include_directories(../../../frameworks/js/napi/fetch/async_context/include)
19include_directories(../../../frameworks/js/napi/fetch/options/include)
20
21include_directories(../../../../../../third_party/curl/include)
22
23link_directories(../../../../../../third_party/curl/cmake-build-debug/lib)
24
25add_executable(
26    test_napi_fetch_exec
27    test_napi_exec.cpp
28    ../log/test_hilog.cpp
29
30    ../../../frameworks/js/napi/fetch/fetch_module/src/fetch_module.cpp
31    ../../../frameworks/js/napi/fetch/constant/src/constant.cpp
32    ../../../frameworks/js/napi/fetch/async_context/src/fetch_context.cpp
33    ../../../frameworks/js/napi/fetch/async_work/src/fetch_async_work.cpp
34    ../../../frameworks/js/napi/fetch/options/src/fetch_response.cpp
35    ../../../frameworks/js/napi/fetch/options/src/fetch_request.cpp
36    ../../../frameworks/js/napi/fetch/fetch_exec/src/fetch_exec.cpp
37)
38
39target_link_libraries(test_napi_fetch_exec curl-d)
40target_link_libraries(test_napi_fetch_exec ace_napi_quickjs)
41target_link_libraries(test_napi_fetch_exec quickjs)
42target_link_libraries(test_napi_fetch_exec uv)
43target_link_libraries(test_napi_fetch_exec securec)
44target_link_libraries(test_napi_fetch_exec gtestd)
45target_link_libraries(test_napi_fetch_exec gmockd)
46target_link_libraries(test_napi_fetch_exec gtest_maind)
47target_link_libraries(test_napi_fetch_exec gmock_maind)
48target_link_libraries(test_napi_fetch_exec pthread)
49target_link_libraries(test_napi_fetch_exec dl)
50target_link_libraries(test_napi_fetch_exec nghttp2)
51target_link_libraries(test_napi_fetch_exec netstack_utils)
52
53add_compile_definitions(NO_SSL_CERTIFICATION=0)
54add_compile_definitions(HTTP_CURL_PRINT_VERBOSE=0)
55add_compile_definitions(NETSTACK_USE_PROXY=0)
56add_compile_definitions(NETSTACK_PROXY_URL_PORT="xxxx:xxxx")
57add_compile_definitions(NETSTACK_PROXY_TYPE=CURLPROXY_HTTP)
58add_compile_definitions(NETSTACK_PROXY_PASS="xxxx:xxxx")
59add_compile_definitions(SERVER_IP="x.x.x.x")
60set(CMAKE_CXX_FLAGS -g)
61