master
1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
13#
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23###########################################################################
24find_program(TEST_NGHTTPX "nghttpx")
25if(NOT TEST_NGHTTPX)
26 set(TEST_NGHTTPX "")
27endif()
28mark_as_advanced(TEST_NGHTTPX)
29# Consumed variables: TEST_NGHTTPX
30configure_file("config.in" "${CMAKE_CURRENT_BINARY_DIR}/config" @ONLY)
32add_custom_target(tt)
33if(BUILD_CURL_EXE)
34 add_dependencies(tt "curlinfo")
35endif()
36if(CURL_BUILD_EVERYTHING)
37 set_target_properties(tt PROPERTIES EXCLUDE_FROM_ALL FALSE)
38endif()
40if(CURL_CLANG_TIDY)
41 add_custom_target(tests-clang-tidy)
42 add_dependencies(tt tests-clang-tidy)
43endif()
44if(CURL_ANALYZER_CFLAGS)
45 set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS ${CURL_ANALYZER_CFLAGS})
46endif()
48add_custom_target(testdeps)
49add_dependencies(testdeps "tt")
51add_subdirectory(http)
52add_subdirectory(perf)
53add_subdirectory(server)
54add_subdirectory(libtest)
55if(BUILD_CURL_EXE)
56 add_subdirectory(tunit)
57endif()
58add_subdirectory(unit)
59add_subdirectory(certs)
61# Add a runtests target with customized flags
62function(curl_add_runtests _targetname _test_flags)
63 if(NOT BUILD_LIBCURL_DOCS)
64 string(APPEND _test_flags " !documentation")
65 endif()
66 set(_depends "")
67 # Skip walking through dependent targets before running tests in CI.
68 # This avoids: GNU Make doing a slow re-evaluation of all targets and
69 # skipping them, MSBuild doing a re-evaluation, and actually rebuilding them.
70 if(NOT _targetname STREQUAL "test-ci")
71 if(BUILD_CURL_EXE)
72 list(APPEND _depends "${EXE_NAME}")
73 endif()
74 list(APPEND _depends "testdeps")
75 endif()
76 set(_setenvs "")
77 if(CMAKE_CONFIGURATION_TYPES)
78 list(APPEND _setenvs "CURL_DIRSUFFIX=$<CONFIG>")
79 endif()
80 if(WIN32 AND NOT CMAKE_HOST_WIN32)
81 list(APPEND _setenvs "CURL_TEST_EXE_EXT_SRV=${CMAKE_EXECUTABLE_SUFFIX}") # .exe
82 list(APPEND _setenvs "CURL_TEST_EXE_EXT_TOOL=${CMAKE_EXECUTABLE_SUFFIX}") # .exe
83 list(APPEND _setenvs "CURL_TEST_EXE_RUNNER=wine")
84 endif()
85 if(_setenvs)
86 set(_setenvs "${CMAKE_COMMAND}" -E env ${_setenvs})
87 endif()
88 # Use a special '$TFLAGS' placeholder as last argument which is replaced
89 # by the contents of the environment variable in runtests.pl.
90 # This is a workaround for CMake's limitation where commands executed by
91 # 'make' or 'ninja' cannot portably reference environment variables.
92 string(REPLACE " " ";" _test_flags_list "${_test_flags}")
93 add_custom_target(${_targetname}
94 COMMAND
95 ${_setenvs}
96 "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runtests.pl"
97 ${_test_flags_list}
98 "\$TFLAGS"
99 DEPENDS "${_depends}"
100 VERBATIM USES_TERMINAL
101 )
102endfunction()
104# Add a pytests target with customized flags
105function(curl_add_pytests _targetname _test_flags)
106 set(_depends "")
107 if(NOT _targetname STREQUAL "pytest-ci")
108 if(BUILD_CURL_EXE)
109 list(APPEND _depends "${EXE_NAME}" "curlinfo")
110 endif()
111 list(APPEND _depends "libtests")
112 list(APPEND _depends "build-certs")
113 endif()
114 string(REPLACE " " ";" _test_flags_list "${_test_flags}")
115 add_custom_target(${_targetname}
116 COMMAND pytest ${_test_flags_list} "${CMAKE_CURRENT_SOURCE_DIR}/http${_CURL_PYTEST}"
117 DEPENDS "${_depends}"
118 VERBATIM USES_TERMINAL
119 )
120endfunction()
122# Create configurehelp.pm, used by tests needing to run the C preprocessor.
123if(MSVC OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
124 set(CURL_CPP "\"${CMAKE_C_COMPILER}\" -E")
125 if(APPLE AND CMAKE_OSX_SYSROOT)
126 string(APPEND CURL_CPP " -isysroot ${CMAKE_OSX_SYSROOT}")
127 endif()
128 string(APPEND CURL_CPP " ${CMAKE_C_FLAGS}")
129 # Add header directories, like autotools builds do.
130 get_property(_include_dirs TARGET ${LIB_SELECTED} PROPERTY INCLUDE_DIRECTORIES)
131 foreach(_include_dir IN LISTS _include_dirs)
132 string(APPEND CURL_CPP " -I${_include_dir}")
133 endforeach()
134else()
135 set(CURL_CPP "cpp")
136endif()
137# Generate version script for the linker, for versioned symbols.
138# Consumed variable:
139# CURL_CPP
140configure_file(
141 "${CMAKE_CURRENT_SOURCE_DIR}/configurehelp.pm.in"
142 "${CMAKE_CURRENT_BINARY_DIR}/configurehelp.pm" @ONLY)
144curl_add_runtests(tests "-a") # Avoid 'test', which is a reserved target name in CMake
145curl_add_runtests(test-quiet "-a -s")
146curl_add_runtests(test-am "-a -am")
147curl_add_runtests(test-full "-a -p -r")
148# ~flaky means that it ignores results of tests using the flaky keyword
149curl_add_runtests(test-nonflaky "-a -p ~flaky ~timing-dependent")
150curl_add_runtests(test-ci "-a -p ~flaky ~timing-dependent -r --retry=5 -j20 --buildinfo")
151curl_add_runtests(test-torture "-a -t -j20")
152curl_add_runtests(test-event "-a -e")
154curl_add_pytests(curl-pytest "-n auto")
155curl_add_pytests(curl-pytest-ci "-n auto -v")
Diagnostics4 git calls · 164 ms
CallStatusSizeTime0164 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit4 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=4 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch2002.2 KiB157 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=157 git.response.bytes=2301 git.response.cache=MISS git.response.duration_ms=157 git.fetch.wants=c6dd7298326761bbe9706a47e8412729f5e742f7 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=2301 git.pkt.payload.max=2280 git.sideband.band1.bytes=2279 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e1d238e8493f27
- Request
- e5f605c2…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format