From e29ae4dea8522c83cb5719d6110a99df133ab59f Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 15 Feb 2026 16:17:00 +0300 Subject: [PATCH] Add check.bat - Windows test runner script --- check.bat | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 check.bat diff --git a/check.bat b/check.bat new file mode 100644 index 0000000..e44bd96 --- /dev/null +++ b/check.bat @@ -0,0 +1,60 @@ +@echo off +setlocal EnableDelayedExpansion + +echo ========================================== +echo uTun Test Suite - Windows +echo ========================================== +echo. + +set "TESTS_DIR=tests" +set "LOGS_DIR=tests\logs" +set "PASSED=0" +set "FAILED=0" +set "TOTAL=0" + +:: Create logs directory if not exists +if not exist "%LOGS_DIR%" mkdir "%LOGS_DIR%" + +:: List of all test executables +set "TEST_LIST=test_etcp_crypto test_crypto test_etcp_two_instances test_etcp_simple_traffic test_etcp_minimal test_etcp_100_packets test_pkt_normalizer_etcp test_pkt_normalizer_standalone test_etcp_api test_ll_queue test_ecc_encrypt test_intensive_memory_pool test_memory_pool_and_config test_packet_dump test_u_async_comprehensive test_u_async_performance test_debug_categories test_config_debug test_route_lib test_bgp_route_exchange bench_timeout_heap bench_uasync_timeouts" + +echo Running tests... +echo. + +for %%t in (%TEST_LIST%) do ( + set /a TOTAL+=1 + set "TEST_EXE=%TESTS_DIR%\%%t.exe" + set "LOG_FILE=%LOGS_DIR%\%%t.log" + + if exist "!TEST_EXE!" ( + echo [RUN] %%t.exe + "!TEST_EXE!" > "!LOG_FILE!" 2>&1 + if !ERRORLEVEL! equ 0 ( + echo [PASS] %%t.exe + set /a PASSED+=1 + ) else ( + echo [FAIL] %%t.exe ^(exit code: !ERRORLEVEL!^) + set /a FAILED+=1 + ) + ) else ( + echo [SKIP] %%t.exe ^(not found^) + ) +) + +echo. +echo ========================================== +echo Test Summary +echo ========================================== +echo Total: %TOTAL% +echo Passed: %PASSED% +echo Failed: %FAILED% +echo. + +if %FAILED% equ 0 ( + echo All tests PASSED! + exit /b 0 +) else ( + echo Some tests FAILED! + echo Check logs in %LOGS_DIR% for details + exit /b 1 +)