Skip to content

Instantly share code, notes, and snippets.

@pana-cc
Last active July 13, 2018 12:15
Show Gist options
  • Save pana-cc/90d75877746e11aad886d73e2b073acc to your computer and use it in GitHub Desktop.
Save pana-cc/90d75877746e11aad886d73e2b073acc to your computer and use it in GitHub Desktop.
@echo off
SET /A ExitCode=0
echo ------------------------
echo Call: Scripts\RunEditModeTests.bat
call Scripts\RunEditModeTests.bat
if %errorlevel% neq 0 SET ExitCode=%errorlevel%
echo ------------------------
echo Call: Scripts\RunPlayModeTests.bat
call Scripts\RunPlayModeTests.bat
if %errorlevel% neq 0 SET ExitCode=%errorlevel%
echo ========================
if %ExitCode% equ 0 (
echo ALL TESTS: PASS
) else (
echo ALL TESTS: FAIL %ExitCode%
)
echo ------------------------
echo Call: Scripts\MSBuildSln.bat
call Scripts\MSBuildSln.bat
if %errorlevel% neq 0 SET ExitCode=%errorlevel%
EXIT /B %ExitCode%
@echo off
echo MSBuild Unity solution Telerik\Telerik.sln with warnings-as-errors
MSBuild.exe %~dp0..\Telerik\Telerik.sln /t:Clean,Build /verbosity:quiet /p:TreatWarningsAsErrors=true /p:OutDir=%~dp0..\bin\unity-dll\ /p:Configuration=Release
@echo off
echo Running EditMode Tests...
start /WAIT Unity.exe -runTests -projectPath %~dp0..\Telerik -testResults %~dp0..\bin\TestResultsEditMode.xml -logPath %~dp0..\bin\TestResultsEditMode.log -testPlatform editmode
if %errorlevel% equ 0 (
echo EditMode Tests: PASS
) else (
echo EditMode Tests: FAIL %errorlevel%
)
EXIT /B %errorlevel%
@echo off
echo Running PlayMode Tests...
start /WAIT Unity.exe -runTests -projectPath %~dp0..\Telerik -testResults %~dp0..\bin\TestResultsPlayMode.xml -logPath %~dp0..\bin\TestResultsPlayMode.log -testPlatform playmode
if %errorlevel% equ 0 (
echo PlayMode Tests: PASS
) else (
echo PlayMode Tests: FAIL %errorlevel%
)
EXIT /B %errorlevel%
@pana-cc
Copy link
Author

pana-cc commented Jul 13, 2018

Running the Build.bat will start the Unity editor and execute edit mode and play mode tests and rebuild the Unity .sln with warnings as errors.
You need MSBuild.exe and Unity.exe added to your PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment