summaryrefslogtreecommitdiff
path: root/run-tests.bat
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-03 19:53:40 +0100
committerw0rp <devw0rp@gmail.com>2018-07-03 19:53:40 +0100
commit7ce919e6909d0d90dd467e165b6ddcfa8adc6bdc (patch)
treecc61795d27b2d22395b66dd0b51422a790e63503 /run-tests.bat
parent25a03dcea1cbe38566523858c149d725bbef93f7 (diff)
downloadale-7ce919e6909d0d90dd467e165b6ddcfa8adc6bdc.zip
Re-run Windows tests when they fail at least once
Diffstat (limited to 'run-tests.bat')
-rw-r--r--run-tests.bat14
1 files changed, 14 insertions, 0 deletions
diff --git a/run-tests.bat b/run-tests.bat
index 4650516d..a3b47056 100644
--- a/run-tests.bat
+++ b/run-tests.bat
@@ -10,7 +10,21 @@ REM Use the first argument for selecting tests to run.
if not "%1"=="" set tests=%1
set VADER_OUTPUT_FILE=%~dp0\vader_output
+REM Automatically re-run Windows tests, which can fail some times.
+set tries=0
+
+RUN_TESTS:
+set /a tries=%tries%+1
type nul > "%VADER_OUTPUT_FILE%"
C:\vim\vim\vim80\vim.exe -u test/vimrc "+Vader! %tests%"
+set code=%ERRORLEVEL%
+
+IF %code% EQU 0 GOTO :SHOW_RESULTS
+IF %tries% GEQ 2 GOTO :SHOW_RESULTS
+GOTO :RUN_TESTS
+
+SHOW_RESULTS:
type "%VADER_OUTPUT_FILE%"
del "%VADER_OUTPUT_FILE%"
+
+exit /B %code%