-
Notifications
You must be signed in to change notification settings - Fork 0
Build and Test
贡献者如何编库、跑用户态协议测试。调用方只需 构建。
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1 -Configuration Debug -Platform x64
msbuild wknet.sln /m /restore /p:Configuration=Debug /p:Platform=x64使用 pwsh。Debug/Release 均视警告为错误。
产物:src/wknetlib/<Platform>/<Configuration>/wknetlib.lib。
通过 tools/build-tests.ps1 逐项构建并运行:
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_parser_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_chunked_decoder_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test websocket_frame_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test websocket_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test sse_parser_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test sse_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http2_frame_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test hpack_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http2_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_crypto_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_handshake_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_record_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_interop_matrix_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_api_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test high_level_api_tests -Run回归组(含 SSE)也可:
pwsh -NoLogo -NoProfile -File .\tools\run-http3-test-suite.ps1 -Group Regression已构建二进制可直接运行:.\tests\out\bin\<name>.exe。
pwsh -NoLogo -NoProfile -File .\tests\integration\tls_matrix.ps1 -Configuration Debug -Platform x64仅使用 127.0.0.1;缺少 OpenSSL/BoringSSL 时明确 SKIP。
不要用
tests/integration/https_smoke.ps1作为常规路径(部分环境会卡住)。
| 路径 | 用途 |
|---|---|
src/wknettest/samples/HighLevelApiSamples.cpp |
产品 API 场景(含 SSE fake transport 样品) |
src/wknettest/samples/AdvancedScenarioSamples.cpp |
边界与错误路径 |
tests/high_level_api_tests.cpp |
用户态 API 回归 |
tests/sse_parser_tests.cpp |
SSE 解析器 |
tests/sse_client_tests.cpp |
SSE 客户端 + 重连 |
测试钩子见 内部边界。Trace 检查:
pwsh -NoLogo -NoProfile -File .\tools\check-trace-events.ps1How contributors build the library and run user-mode protocol tests. Product integrators only need Build.
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1 -Configuration Debug -Platform x64
msbuild wknet.sln /m /restore /p:Configuration=Debug /p:Platform=x64Use pwsh. Debug/Release treat warnings as errors.
Output: src/wknetlib/<Platform>/<Configuration>/wknetlib.lib.
Build and run each suite through tools/build-tests.ps1:
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_parser_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_chunked_decoder_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test websocket_frame_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test websocket_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test sse_parser_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test sse_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http2_frame_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test hpack_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http2_client_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_crypto_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_handshake_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_record_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test tls_interop_matrix_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test http_api_tests -Run
pwsh -NoLogo -NoProfile -File .\tools\build-tests.ps1 -Test high_level_api_tests -RunRegression group (includes SSE):
pwsh -NoLogo -NoProfile -File .\tools\run-http3-test-suite.ps1 -Group RegressionBuilt binaries also run from .\tests\out\bin\<name>.exe.
pwsh -NoLogo -NoProfile -File .\tests\integration\tls_matrix.ps1 -Configuration Debug -Platform x64Uses only 127.0.0.1; SKIPs cleanly when OpenSSL/BoringSSL is missing.
Do not use
tests/integration/https_smoke.ps1as a regular path (it may hang in some environments).
| Path | Purpose |
|---|---|
src/wknettest/samples/HighLevelApiSamples.cpp |
Product API scenarios (includes SSE fake-transport sample) |
src/wknettest/samples/AdvancedScenarioSamples.cpp |
Edge and error paths |
tests/high_level_api_tests.cpp |
User-mode API regression |
tests/sse_parser_tests.cpp |
SSE parser |
tests/sse_client_tests.cpp |
SSE client + reconnect |
Test hooks: Internals. Trace check:
pwsh -NoLogo -NoProfile -File .\tools\check-trace-events.ps1-
开始使用 / Get Started
-
概念与行为 / Concepts
-
协议指南 / Protocols
-
API 参考 / API Reference
-
贡献与项目 / Contribute