-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path_Tests.bat
66 lines (47 loc) · 1.64 KB
/
_Tests.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
SetLocal EnableDelayedExpansion
set url=negrutiu.com/
set index=0
pushd "%~dp0\bin"
for /d %%d in (*-curl_openssl-*.*) do call :test_dir "%%d\bin" openssl
for /d %%d in (*-curl_schannel-*.*) do call :test_dir "%%d\bin" schannel
popd
echo.
pause
exit /B
:test_dir
set /a index += 1
echo.
echo %index%. %~1
if exist "%~1\curl.exe" call :test_curl "%~1\curl.exe" "%~2"
if exist "%~1\libcurl.exe" call :test_curl "%~1\libcurl.exe" "%~2"
exit /B
:test_curl
set txt=
REM set err=[*]&& "%~1" -V | findstr "SSL" > NUL || set err=[ ]
REM set txt=!txt! SSL:%err%
set err=[*]&& "%~1" -V | findstr "TLS-SRP" > NUL || set err=[ ]
set txt=!txt! TLS-SRP:%err%
set err=[*]&& "%~1" -V | findstr "HTTP2" > NUL || set err=[ ]
set txt=!txt! HTTP2:%err%
set err=[*]&& "%~1" -V | findstr "HTTPS-proxy" > NUL || set err=[ ]
set txt=!txt! HTTPS-proxy:%err%
set err=[*]&& "%~1" -V | findstr "libz" > NUL || set err=[ ]
set txt=!txt! libz:%err%
"%~1" -L -v -w "HTTPCODE:%%{response_code}" %url% > "%~dp1\test-data.md" 2> "%~dp1\test-trace.md"
set txt=!txt! CURLE:[%errorlevel%]
set err=???&& for /f "delims=: tokens=2" %%l in ('type "%~dp1\test-data.md" ^| findstr "HTTPCODE:"') do set err=%%l
set txt=!txt! HTTP-status:[%err%]
set err=[*]&& findstr "GET / HTTP/2" "%~dp1\test-trace.md" > NUL || set err=[ ]
set txt=!txt! HTTP/2:%err%
if /i "%~2" equ "openssl" (
set err=[*]&& findstr "using TLSv1.3" "%~dp1\test-trace.md" > NUL || set err=[ ]
set txt=!txt! TLSv1.3:%err%
) else (
set txt=!txt! TLSv1.3:[?]
)
for /f "delims=" %%i in ('%~1 -V ^| findstr "curl"') do set txt=!txt! %%i
del "%~dp1\test-trace.md" 2> NUL
del "%~dp1\test-data.md" 2> NUL
echo !txt!
exit /B