@echo off REM ============================================================ REM HCIE-Rust v3.05 — Categorized Test Runner (Windows .bat) REM Usage: run_tests_categorized.bat [--no-io] [--no-4k] [--ignored] REM ============================================================ setlocal DisableDelayedExpansion set "ROOT_DIR=%~dp0" cd /d "%ROOT_DIR%" || exit /b 1 setlocal EnableDelayedExpansion echo ============================================================ echo HCIE-Rust v3.05 — Categorized Test Runner echo Root: %ROOT_DIR% echo ============================================================ set PASS=0 set FAIL=0 set SKIP=0 set FAILED_CRATES= set SKIPPED_CRATES= set SKIP_IO=0 set SKIP_4K=0 set INCLUDE_IGNORED=0 set CARGO_ARGS= set TEST_ARGS= set PARSING_TEST_ARGS=0 :parse_args if "%~1"=="" goto :done_parse if "!PARSING_TEST_ARGS!"=="1" goto :collect_test_arg if /I "%~1"=="--no-io" goto :enable_no_io if /I "%~1"=="--no-4k" goto :enable_no_4k if /I "%~1"=="--ignored" goto :enable_ignored if "%~1"=="--" goto :begin_test_args set "CARGO_ARGS=!CARGO_ARGS! "%~1"" shift goto :parse_args :enable_no_io set SKIP_IO=1 shift goto :parse_args :enable_no_4k set SKIP_4K=1 shift goto :parse_args :enable_ignored set INCLUDE_IGNORED=1 shift goto :parse_args :begin_test_args set PARSING_TEST_ARGS=1 shift goto :parse_args :collect_test_arg set "TEST_ARGS=!TEST_ARGS! "%~1"" shift goto :parse_args :done_parse call :RUN_CATEGORY "Layer 1: DATA" hcie-protocol hcie-color call :RUN_CATEGORY "Layer 2: Blend/Brush" hcie-blend hcie-brush-engine call :RUN_CATEGORY "Layer 2: Draw/Composite/Filter" hcie-draw hcie-composite hcie-filter call :RUN_CATEGORY "Layer 2: Selection/Vector/History" hcie-selection hcie-vector hcie-history if %SKIP_IO%==1 ( echo [SKIP] hcie-io set /a SKIP+=1 set SKIPPED_CRATES=!SKIPPED_CRATES! hcie-io ) else ( call :RUN_CRATE hcie-io ) call :RUN_CATEGORY "Layer 2: PSD/Vision/Build" psd hcie-vision hcie-build-info if %SKIP_4K%==1 ( call :RUN_CRATE hcie-engine-api --skip benchmark_4k_stroke_on_multilayer_document ) else ( call :RUN_CRATE hcie-engine-api ) call :RUN_CATEGORY "Layer 6: GUI egui" hcie-gui-egui call :RUN_CATEGORY "Layer 6: GUI iced" hcie-iced-gui call :RUN_CATEGORY "Brush Catalogs" hcie-dry-media-brushes hcie-paint-brushes hcie-digital-brushes hcie-watercolor-brushes hcie-ink-brushes if %INCLUDE_IGNORED%==1 ( echo. echo ===== Running IGNORED tests ===== call :RUN_IGNORED hcie-engine-api call :RUN_IGNORED hcie-brush-engine call :RUN_IGNORED hcie-iced-gui call :RUN_IGNORED hcie-fx ) echo ============================================================ echo SUMMARY: %PASS% test runs passed, %FAIL% failed, %SKIP% crates skipped if not "%FAILED_CRATES%"=="" echo Failed crates:%FAILED_CRATES% if not "%SKIPPED_CRATES%"=="" echo Skipped crates:%SKIPPED_CRATES% echo ============================================================ exit /b %FAIL% :RUN_CATEGORY set CATEGORY=%~1 shift echo. echo ===== Category: %CATEGORY% ===== :RUN_CATEGORY_LOOP if "%~1"=="" goto :EOF call :RUN_CRATE %~1 shift goto RUN_CATEGORY_LOOP :RUN_CRATE set "CRATE=%~1" set "CRATE_TEST_ARGS=" :RUN_CRATE_ARG_LOOP shift if "%~1"=="" goto :RUN_CRATE_EXECUTE set "CRATE_TEST_ARGS=!CRATE_TEST_ARGS! "%~1"" goto :RUN_CRATE_ARG_LOOP :RUN_CRATE_EXECUTE set "TEST_SEPARATOR=" if not "!CRATE_TEST_ARGS!!TEST_ARGS!"=="" set "TEST_SEPARATOR=--" echo --- Running: !CRATE! --- cargo test -p "!CRATE!" !CARGO_ARGS! !TEST_SEPARATOR! !CRATE_TEST_ARGS! !TEST_ARGS! if errorlevel 1 ( set /a FAIL+=1 set FAILED_CRATES=!FAILED_CRATES! !CRATE! ) else ( set /a PASS+=1 ) goto :EOF :RUN_IGNORED set "IGNORED_CRATE=%~1" cargo test -p "!IGNORED_CRATE!" !CARGO_ARGS! -- --ignored !TEST_ARGS! if errorlevel 1 ( set /a FAIL+=1 set FAILED_CRATES=!FAILED_CRATES! !IGNORED_CRATE![ignored] ) else ( set /a PASS+=1 ) goto :EOF