diff --git a/appveyor.yml b/appveyor.yml index 324d0c5e..df8aa9dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,11 +20,4 @@ build_script: test_script: - for %%f in ("build\VStudio\build\%CONFIGURATION%\winfsp-*.msi") do start /wait msiexec /i %%f /qn INSTALLLEVEL=1000 -- -- appveyor AddTest winfsp-tests-x64 -Outcome Running -- build\VStudio\build\%CONFIGURATION%\winfsp-tests-x64.exe -- appveyor UpdateTest winfsp-tests-x64 -Outcome Passed -- -- appveyor AddTest winfsp-tests-x86 -Outcome Running -- build\VStudio\build\%CONFIGURATION%\winfsp-tests-x86.exe -- appveyor UpdateTest winfsp-tests-x86 -Outcome Passed +- tools\run-tests.bat %CONFIGURATION% diff --git a/tools/run-tests.bat b/tools/run-tests.bat new file mode 100644 index 00000000..41dbae50 --- /dev/null +++ b/tools/run-tests.bat @@ -0,0 +1,56 @@ +@echo off + +setlocal + +set Configuration=Release +if not X%1==X set Configuration=%1 + +cd %~dp0..\build\VStudio +if not exist build\%Configuration% ( + echo === No tests found 1>&2 + goto fail +) +cd build\%Configuration% + +set testpass=0 +set testfail=0 +for %%f in (winfsp-tests-x64 winfsp-tests-x86 :winfstest) do ( + echo === Running %%f + + if defined APPVEYOR ( + appveyor AddTest "%%f" -FileName None -Framework None -Outcome Running + ) + + call %%f + + if errorlevel 1 ( + set /a testfail=testfail+1 + + echo === Failed %%f + + if defined APPVEYOR ( + appveyor UpdateTest "%%f" -FileName None -Framework None -Outcome Passed -Duration 0 + ) + ) else ( + set /a testpass=testpass+1 + + echo === Passed %%f + + if defined APPVEYOR ( + appveyor UpdateTest "%%f" -FileName None -Framework None -Outcome Failed -Duration 0 + ) + ) + echo: +) + +set /a total=testpass+testfail +echo === Total: %testpass%/%total% +if not %testfail%==0 goto fail + +exit /b 0 + +:fail +exit /b 1 + +:winfstest +exit /b 0