-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvisual_test.bat
More file actions
50 lines (43 loc) · 1.42 KB
/
visual_test.bat
File metadata and controls
50 lines (43 loc) · 1.42 KB
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
@echo off
setlocal enabledelayedexpansion
REM PostForge Visual Regression Test Launcher
REM Activates virtual environment and runs visual_test.py with passed arguments
REM
REM Usage:
REM visual_test.bat --baseline # Generate baseline
REM visual_test.bat # Compare against baseline
REM visual_test.bat --baseline -- -d pdf # Pass -d pdf to postforge
REM visual_test.bat -- --glyph-cache # Pass --glyph-cache to postforge
REM Change to the directory where this script lives
cd /d "%~dp0"
REM Check if virtual environment exists
if not exist "venv\Scripts\python.exe" (
echo Virtual environment not found. Please run install.bat first
exit /b 1
)
REM Split arguments at "--" separator: args before go to visual_test.py,
REM args after get forwarded to postforge via --flags.
set "VISUAL_ARGS="
set "POSTFORGE_ARGS="
set "FOUND_SEP=0"
for %%a in (%*) do (
if "%%a"=="--" (
if !FOUND_SEP!==0 (
set "FOUND_SEP=1"
) else (
set "POSTFORGE_ARGS=!POSTFORGE_ARGS! %%a"
)
) else (
if !FOUND_SEP!==1 (
set "POSTFORGE_ARGS=!POSTFORGE_ARGS! %%a"
) else (
set "VISUAL_ARGS=!VISUAL_ARGS! %%a"
)
)
)
if defined POSTFORGE_ARGS (
venv\Scripts\python visual_test.py %VISUAL_ARGS% --flags %POSTFORGE_ARGS%
) else (
venv\Scripts\python visual_test.py %VISUAL_ARGS%
)
endlocal