Make unit tests available in Release builds

This commit is contained in:
Birunthan Mohanathas 2013-06-13 21:13:57 +03:00
parent c5e2a7a2cb
commit 8a086ffdcb
4 changed files with 19 additions and 11 deletions

View File

@ -20,7 +20,7 @@ echo.
if not exist "%VCVARSALL%" echo ERROR: vcvarsall.bat not found & goto END
call "%VCVARSALL%" x86 > nul
set MSBUILD="msbuild.exe" /p:PlatformToolset=v110_xp;VisualStudioVersion=11.0
set MSBUILD="msbuild.exe" /p:PlatformToolset=v110_xp;VisualStudioVersion=11.0;ExcludeTests=false
if exist "Certificate.bat" call "Certificate.bat" > nul
set SIGNTOOL="signtool.exe" sign /t http://time.certum.pl /f "%CERTFILE%" /p "%CERTKEY%"

View File

@ -13,13 +13,13 @@
</PropertyGroup>
<ItemGroup>
<ClCompile Include="MathParser_Test.cpp">
<ExcludedFromBuild>$(ExcludeTestFile)</ExcludedFromBuild>
<ExcludedFromBuild>$(ExcludeTests)</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="PathUtil_Test.cpp">
<ExcludedFromBuild>$(ExcludeTestFile)</ExcludedFromBuild>
<ExcludedFromBuild>$(ExcludeTests)</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="StringUtil_Test.cpp">
<ExcludedFromBuild>$(ExcludeTestFile)</ExcludedFromBuild>
<ExcludedFromBuild>$(ExcludeTests)</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -48,7 +48,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;Wininet.lib;UxTheme.lib;Winmm.lib;gdiplus.lib;Iphlpapi.lib;shlwapi.lib;d2d1.lib;dwrite.lib;windowscodecs.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>Winmm.dll;Version.dll;d2d1.dll;dwrite.dll</DelayLoadDLLs>
<DelayLoadDLLs>Winmm.dll;Version.dll;d2d1.dll;dwrite.dll;$(DelayLoadTestDLL)</DelayLoadDLLs>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
@ -61,7 +61,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;Wininet.lib;UxTheme.lib;Winmm.lib;gdiplus.lib;Iphlpapi.lib;shlwapi.lib;d2d1.lib;dwrite.lib;windowscodecs.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>Winmm.dll;Version.dll;d2d1.dll;dwrite.dll</DelayLoadDLLs>
<DelayLoadDLLs>Winmm.dll;Version.dll;d2d1.dll;dwrite.dll;$(DelayLoadTestDLL)</DelayLoadDLLs>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
@ -88,7 +88,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ConfigParser_Test.cpp">
<ExcludedFromBuild>$(ExcludeTestFile)</ExcludedFromBuild>
<ExcludedFromBuild>$(ExcludeTests)</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="DialogAbout.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>

View File

@ -32,14 +32,24 @@
<!-- Macros for unit testing. -->
<PropertyGroup Label="UserMacros">
<ExcludeTestFile>true</ExcludeTestFile>
<ExcludeTestFile Condition="'$(Configuration)'=='Debug'">false</ExcludeTestFile>
<!-- This is set to true by Build.bat when building full builds. -->
<ExcludeTests>false</ExcludeTests>
<!-- Non-static projects must delayload CppUnitTestFramework.dll to avoid the "module not found"
errors (since CppUnitTestFramework.dll is available only when running tests). -->
<DelayLoadTestDLL Condition="'$(ConfigurationType)'!='StaticLibrary'">Microsoft.VisualStudio.TestTools.CppUnitTestFramework.dll</DelayLoadTestDLL>
<DelayLoadTestDLL Condition="'$(ExcludeTests)'=='true'"></DelayLoadTestDLL>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(ExcludeTests)'=='false'">
<ClCompile>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<!-- Set the version macros to 0x0601 (Win7) to avoid using Win8 specific features in the Win8 SDK. -->
@ -58,13 +68,11 @@
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ResourceCompile>