summaryrefslogtreecommitdiff
path: root/addons/gdUnit4/runtest.cmd
diff options
context:
space:
mode:
authorradiohotline <radoihotline@disroot.rg>2026-08-25 16:33:56 +0300
committerradiohotline <radoihotline@disroot.rg>2026-08-25 16:33:56 +0300
commita89e744ed0e8c759caf041a580112365bbfe4303 (patch)
treedd61e320904176995727e86a857d00c90d4933ba /addons/gdUnit4/runtest.cmd
parent6d53d8cac78250dc888aa49d5f9d4175c6652feb (diff)
escoria updateHEADmain
Diffstat (limited to 'addons/gdUnit4/runtest.cmd')
-rw-r--r--addons/gdUnit4/runtest.cmd62
1 files changed, 62 insertions, 0 deletions
diff --git a/addons/gdUnit4/runtest.cmd b/addons/gdUnit4/runtest.cmd
new file mode 100644
index 0000000..ad5da4d
--- /dev/null
+++ b/addons/gdUnit4/runtest.cmd
@@ -0,0 +1,62 @@
+@echo off
+setlocal enabledelayedexpansion
+
+:: Initialize variables
+set "godot_binary="
+set "filtered_args="
+
+:: Process all arguments
+set "i=0"
+:parse_args
+if "%~1"=="" goto end_parse_args
+
+if "%~1"=="--godot_binary" (
+ set "godot_binary=%~2"
+ shift
+ shift
+) else (
+ set "filtered_args=!filtered_args! %~1"
+ shift
+)
+goto parse_args
+:end_parse_args
+
+:: If --godot_binary wasn't provided, fallback to environment variable
+if "!godot_binary!"=="" (
+ set "godot_binary=%GODOT_BIN%"
+)
+
+:: Check if we have a godot_binary value from any source
+if "!godot_binary!"=="" (
+ echo Godot binary path is not specified.
+ echo Please either:
+ echo - Set the environment variable: set GODOT_BIN=C:\path\to\godot.exe
+ echo - Or use the --godot_binary argument: --godot_binary C:\path\to\godot.exe
+ exit /b 1
+)
+
+:: Check if the Godot binary exists
+if not exist "!godot_binary!" (
+ echo Error: The specified Godot binary '!godot_binary!' does not exist.
+ exit /b 1
+)
+
+:: Get Godot version and check if it's a mono build
+for /f "tokens=*" %%i in ('"!godot_binary!" --version') do set GODOT_VERSION=%%i
+echo !GODOT_VERSION! | findstr /I "mono" >nul
+if !errorlevel! equ 0 (
+ echo Godot .NET detected
+ echo Compiling c# classes ... Please Wait
+ dotnet build --debug
+ echo done !errorlevel!
+)
+
+:: Run the tests with the filtered arguments
+"!godot_binary!" --path . -s -d res://addons/gdUnit4/bin/GdUnitCmdTool.gd !filtered_args!
+set exit_code=%ERRORLEVEL%
+echo Run tests ends with %exit_code%
+
+:: Run the copy log command
+"!godot_binary!" --headless --path . --quiet -s res://addons/gdUnit4/bin/GdUnitCopyLog.gd !filtered_args! > nul
+set exit_code2=%ERRORLEVEL%
+exit /b %exit_code%