2014-03-14 01:08:07 +04:00
|
|
|
@echo off
|
2014-06-12 11:39:05 +04:00
|
|
|
setlocal enableextensions enabledelayedexpansion
|
|
|
|
|
|
|
|
REM -----------------------------------------------------------------------
|
|
|
|
REM <copyright file="test.bat" company="Outercurve Foundation">
|
|
|
|
REM Copyright (c) 2004, Outercurve Foundation.
|
|
|
|
REM This software is released under Microsoft Reciprocal License (MS-RL).
|
|
|
|
REM The license and further copyright text can be found in the file
|
|
|
|
REM LICENSE.TXT at the root directory of the distribution.
|
|
|
|
REM </copyright>
|
|
|
|
REM -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
set COMMAND=
|
|
|
|
set ENABLERUNTIMETESTS=
|
2014-03-14 01:08:07 +04:00
|
|
|
set EXITCODE=0
|
|
|
|
set FLAVOR=debug
|
2014-06-12 11:39:05 +04:00
|
|
|
set INTEGRATIONTESTS=
|
|
|
|
set WIX_TEST_ROOT=%~dp0
|
|
|
|
set WIX_ROOT=%WIX_TEST_ROOT:~0,-6%
|
2014-03-14 01:08:07 +04:00
|
|
|
|
|
|
|
:Parse_Args
|
2014-06-12 11:39:05 +04:00
|
|
|
if /i "%1"=="" goto :End_Parse_Args
|
|
|
|
if /i "%1"=="debug" set FLAVOR=debug& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="-debug" set FLAVOR=debug& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="/debug" set FLAVOR=debug& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="ship" set FLAVOR=release& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="-ship" set FLAVOR=release& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="/ship" set FLAVOR=release& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="-enableruntimetests" set ENABLERUNTIMETESTS=true& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="/enableruntimetests" set ENABLERUNTIMETESTS=true& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="-integrationtests" set INTEGRATIONTESTS=true& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="/integrationtests" set INTEGRATIONTESTS=true& shift& goto :Parse_Args
|
|
|
|
if /i "%1"=="-?" goto :Help
|
|
|
|
if /i "%1"=="/?" goto :Help
|
|
|
|
if /i "%1"=="-help" goto :Help
|
|
|
|
if /i "%1"=="/help" goto :Help
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo.Invalid argument: %1
|
2014-03-14 01:08:07 +04:00
|
|
|
goto :Help
|
|
|
|
|
|
|
|
:End_Parse_Args
|
2014-06-12 11:39:05 +04:00
|
|
|
set WIX_BUILD_X86=%WIX_ROOT%\build\%FLAVOR%\x86
|
2014-03-14 01:08:07 +04:00
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
REM Specify the test assemblies.
|
|
|
|
set TESTASSEMBLIES=!TESTASSEMBLIES! "%WIX_BUILD_X86%\WixTest.BurnIntegrationTests.dll"
|
|
|
|
set TESTASSEMBLIES=!TESTASSEMBLIES! "%WIX_BUILD_X86%\WixTest.MsbuildIntegrationTests.dll"
|
2014-03-14 01:08:07 +04:00
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
if not "%INTEGRATIONTESTS%"=="true" (
|
|
|
|
set TESTASSEMBLIES=!TESTASSEMBLIES! "%WIX_BUILD_X86%\BurnUnitTest.dll"
|
|
|
|
set TESTASSEMBLIES=!TESTASSEMBLIES! "%WIX_BUILD_X86%\DUtilUnitTest.dll"
|
|
|
|
set TESTASSEMBLIES=!TESTASSEMBLIES! "%WIX_BUILD_X86%\WixTests.dll"
|
2014-03-14 01:08:07 +04:00
|
|
|
)
|
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
for /f "usebackq" %%i in (`where /f xunit.console.clr4.*`) do (
|
|
|
|
set COMMAND=%%i
|
2014-03-14 01:08:07 +04:00
|
|
|
)
|
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
if not "!COMMAND!"=="" (
|
|
|
|
for %%i in (!TESTASSEMBLIES!) do (
|
|
|
|
call !COMMAND! %%i
|
|
|
|
if not "!EXITCODE!"=="0" set EXITCODE=%ERRORLEVEL%
|
|
|
|
)
|
|
|
|
) else (
|
2014-06-13 19:50:20 +04:00
|
|
|
call msbuild "%~dp0\test\All.testproj" /p:Configuration=%FLAVOR%
|
2014-06-12 11:39:05 +04:00
|
|
|
if not "!EXITCODE!"=="0" set EXITCODE=%ERRORLEVEL%
|
2014-03-14 01:08:07 +04:00
|
|
|
)
|
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
goto :End
|
2014-03-14 01:08:07 +04:00
|
|
|
|
|
|
|
:Help
|
|
|
|
echo.
|
|
|
|
echo test.bat - Runs tests against the WiX core toolset
|
|
|
|
echo.
|
2014-06-12 11:39:05 +04:00
|
|
|
echo Usage: test.bat [debug^|ship] [options]
|
2014-03-14 01:08:07 +04:00
|
|
|
echo.
|
|
|
|
echo Options:
|
|
|
|
echo flavor Sets the flavor to either debug (default) or ship
|
2014-06-12 11:39:05 +04:00
|
|
|
echo enableruntimetests Enable runnning tests that can change the machine state
|
|
|
|
echo integrationtests Run only integration tests
|
|
|
|
echo ?^|help Shows this help
|
2014-03-14 01:08:07 +04:00
|
|
|
echo.
|
2014-06-12 11:39:05 +04:00
|
|
|
goto :End
|
2014-03-14 01:08:07 +04:00
|
|
|
|
2014-06-12 11:39:05 +04:00
|
|
|
:End
|
|
|
|
endlocal
|
|
|
|
exit /b !EXITCODE!
|