2012-01-27 01:40:39 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/vc2010/test_compile_settings.lua
|
2012-01-27 18:37:24 +00:00
|
|
|
-- Validate compiler settings in Visual Studio 2010 C/C++ projects.
|
2013-02-08 15:35:14 +00:00
|
|
|
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
|
2012-01-27 01:40:39 +00:00
|
|
|
--
|
|
|
|
|
2013-02-08 15:35:14 +00:00
|
|
|
local suite = test.declare("vstudio_vs2010_compile_settings")
|
2012-01-27 01:40:39 +00:00
|
|
|
local vc2010 = premake.vstudio.vc2010
|
2013-09-13 15:15:36 +00:00
|
|
|
local project = premake.project
|
2012-01-27 01:40:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup
|
|
|
|
--
|
|
|
|
|
|
|
|
local sln, prj, cfg
|
|
|
|
|
|
|
|
function suite.setup()
|
|
|
|
sln, prj = test.createsolution()
|
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare(platform)
|
|
|
|
cfg = project.getconfig(prj, "Debug", platform)
|
2013-02-11 18:25:33 +00:00
|
|
|
vc2010.clCompile(cfg)
|
2012-01-27 01:40:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-12-11 16:17:43 +00:00
|
|
|
--
|
2012-01-27 01:40:39 +00:00
|
|
|
-- Check the basic element structure with default settings.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.defaultSettings()
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2011-11-19 21:50:50 +00:00
|
|
|
<ClCompile>
|
2012-01-27 01:40:39 +00:00
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
2011-11-19 21:50:50 +00:00
|
|
|
<Optimization>Disabled</Optimization>
|
2012-01-27 01:40:39 +00:00
|
|
|
</ClCompile>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2013-08-11 18:27:17 +00:00
|
|
|
---
|
|
|
|
-- Test precompiled header handling; the header should be treated as
|
|
|
|
-- a plain string value, with no path manipulation applied, since it
|
|
|
|
-- needs to match the value of the #include statement used in the
|
|
|
|
-- project code.
|
|
|
|
---
|
2012-01-27 01:40:39 +00:00
|
|
|
|
|
|
|
function suite.usePrecompiledHeaders_onPrecompiledHeaders()
|
2013-08-11 18:27:17 +00:00
|
|
|
location "build"
|
2012-03-18 21:53:19 +00:00
|
|
|
pchheader "include/afxwin.h"
|
2012-01-27 01:40:39 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
2013-08-11 18:27:17 +00:00
|
|
|
<PrecompiledHeaderFile>include/afxwin.h</PrecompiledHeaderFile>
|
2012-01-27 01:40:39 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2013-08-11 18:27:17 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
-- The NoPCH flag should override any other PCH settings.
|
|
|
|
---
|
|
|
|
|
2012-01-27 01:40:39 +00:00
|
|
|
function suite.noPrecompiledHeaders_onNoPCH()
|
|
|
|
pchheader "afxwin.h"
|
|
|
|
flags "NoPCH"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If the ExtraWarnings flag is specified, pump up the volume.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.warningLevel_onExtraWarnings()
|
|
|
|
flags "ExtraWarnings"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level4</WarningLevel>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-04-10 10:03:31 +00:00
|
|
|
--
|
|
|
|
-- If the NoWarnings flag is specified, mute on warnings.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.warningLevel_onNoWarnings()
|
|
|
|
flags "NoWarnings"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
2013-09-18 09:37:36 +00:00
|
|
|
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
2012-04-10 10:03:31 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
--
|
|
|
|
-- NoWarnings disables ExtraWarnings FatalWarnings flagss.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.warningLevel_onNoWarningsOverOtherWarningsFlags()
|
|
|
|
flags { "NoWarnings", "ExtraWarnings", "FatalWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
2013-09-18 09:37:36 +00:00
|
|
|
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
2012-04-10 10:03:31 +00:00
|
|
|
]]
|
|
|
|
end
|
2012-01-27 01:40:39 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the optimization flags.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.optimization_onOptimize()
|
|
|
|
flags "Optimize"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Full</Optimization>
|
|
|
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
|
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
|
|
|
<StringPooling>true</StringPooling>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.optimization_onOptimizeSize()
|
|
|
|
flags "OptimizeSize"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>MinSpace</Optimization>
|
|
|
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
|
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
2011-11-19 21:50:50 +00:00
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
2012-01-27 01:40:39 +00:00
|
|
|
<StringPooling>true</StringPooling>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.optimization_onOptimizeSpeed()
|
|
|
|
flags "OptimizeSpeed"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>MaxSpeed</Optimization>
|
2011-11-19 21:50:50 +00:00
|
|
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
2012-01-27 01:40:39 +00:00
|
|
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
|
|
|
<StringPooling>true</StringPooling>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-01-27 22:52:46 +00:00
|
|
|
function suite.omitFrames_onNoFramePointer()
|
|
|
|
flags "NoFramePointer"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<OmitFramePointers>true</OmitFramePointers>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-01-27 01:40:39 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- If defines are specified, the <PreprocessorDefinitions> element should be added.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.preprocessorDefinitions_onDefines()
|
|
|
|
defines { "DEBUG", "_DEBUG" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
2011-11-19 21:50:50 +00:00
|
|
|
<WarningLevel>Level3</WarningLevel>
|
2012-01-27 01:40:39 +00:00
|
|
|
<PreprocessorDefinitions>DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2013-02-08 15:35:14 +00:00
|
|
|
|
2012-01-27 01:40:39 +00:00
|
|
|
--
|
|
|
|
-- If build options are specified, the <AdditionalOptions> element should be specified.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.additionalOptions_onBuildOptions()
|
|
|
|
buildoptions { "/xyz", "/abc" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2011-11-19 21:50:50 +00:00
|
|
|
<ClCompile>
|
2012-01-27 01:40:39 +00:00
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
2011-11-19 21:50:50 +00:00
|
|
|
<Optimization>Disabled</Optimization>
|
2012-01-27 01:40:39 +00:00
|
|
|
<AdditionalOptions>/xyz /abc %(AdditionalOptions)</AdditionalOptions>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If include directories are specified, the <AdditionalIncludeDirectories> should be added.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.additionalIncludeDirs_onIncludeDirs()
|
|
|
|
includedirs { "include/lua", "include/zlib" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<AdditionalIncludeDirectories>include\lua;include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Turn off minimal rebuilds if the NoMinimalRebuild flag is set.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.minimalRebuild_onNoMinimalRebuild()
|
|
|
|
flags "NoMinimalRebuild"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Can't minimal rebuild with the C7 debugging format.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.minimalRebuild_onC7()
|
|
|
|
debugformat "C7"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- If the StaticRuntime flag is specified, add the <RuntimeLibrary> element.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibrary_onStaticRuntime()
|
|
|
|
flags { "StaticRuntime" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.runtimeLibrary_onStaticRuntimeAndSymbols()
|
|
|
|
flags { "StaticRuntime", "Symbols" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
2011-11-19 21:50:50 +00:00
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
|
|
|
<ProgramDataBaseFileName>$(OutDir)MyProject.pdb</ProgramDataBaseFileName>
|
2012-01-27 01:40:39 +00:00
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add <TreatWarningAsError> if FatalWarnings flag is set.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.treatWarningsAsError_onFatalWarnings()
|
|
|
|
flags { "FatalWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
2011-11-19 21:50:50 +00:00
|
|
|
<ClCompile>
|
2012-01-27 01:40:39 +00:00
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<TreatWarningAsError>true</TreatWarningAsError>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the handling of the Symbols flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onSymbolsFlag()
|
|
|
|
flags "Symbols"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
|
|
|
<ProgramDataBaseFileName>$(OutDir)MyProject.pdb</ProgramDataBaseFileName>
|
2011-11-19 21:50:50 +00:00
|
|
|
<Optimization>Disabled</Optimization>
|
2012-01-27 01:40:39 +00:00
|
|
|
</ClCompile>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the handling of the C7 debug information format.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onC7DebugFormat()
|
|
|
|
flags "Symbols"
|
|
|
|
debugformat "c7"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
2011-11-19 21:50:50 +00:00
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
2012-01-27 01:40:39 +00:00
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-01-27 22:52:46 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of floating point and SSE flags.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.instructionSet_onSSE()
|
2013-09-27 18:25:10 +00:00
|
|
|
vectorextensions "SSE"
|
2012-01-27 22:52:46 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.instructionSet_onSSE2()
|
2013-09-27 18:25:10 +00:00
|
|
|
vectorextensions "SSE2"
|
2012-01-27 22:52:46 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.floatingPoint_onFloatFast()
|
|
|
|
flags "FloatFast"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<FloatingPointModel>Fast</FloatingPointModel>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.floatingPoint_onFloatStrict()
|
|
|
|
flags "FloatStrict"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<FloatingPointModel>Strict</FloatingPointModel>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
|
2012-01-27 22:52:46 +00:00
|
|
|
--
|
|
|
|
-- Verify character handling.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.wchar_onNative()
|
|
|
|
flags "NativeWChar"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.wchar_onNoNative()
|
|
|
|
flags "NoNativeWChar"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check exception handling and RTTI.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.exceptions_onNoExceptions()
|
|
|
|
flags "NoExceptions"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<ExceptionHandling>false</ExceptionHandling>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.exceptions_onSEH()
|
|
|
|
flags "SEH"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<ExceptionHandling>Async</ExceptionHandling>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.runtimeTypeInfo_onNoRTTI()
|
|
|
|
flags "NoRTTI"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
|
|
|
]]
|
|
|
|
end
|
2012-02-02 00:05:13 +00:00
|
|
|
|
2013-08-15 22:22:23 +00:00
|
|
|
function suite.runtimeTypeInfo_onNoRTTI()
|
|
|
|
flags "NoBufferSecurityCheck"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-02-02 00:05:13 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- On Win32 builds, use the Edit-and-Continue debug information format.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.debugFormat_onWin32()
|
|
|
|
flags "Symbols"
|
|
|
|
architecture "x32"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
|
|
|
]]
|
|
|
|
end
|
2012-11-06 21:42:44 +00:00
|
|
|
|
2013-02-08 15:35:14 +00:00
|
|
|
|
2012-02-02 00:05:13 +00:00
|
|
|
--
|
|
|
|
-- Edit-and-Continue is not support on 64-bit builds.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.debugFormat_onWin64()
|
|
|
|
flags "Symbols"
|
|
|
|
architecture "x64"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
|
2012-02-02 00:05:13 +00:00
|
|
|
--
|
|
|
|
-- Check the handling of the NoEditAndContinue flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.debugFormat_onNoEditAndContinue()
|
|
|
|
flags { "Symbols", "NoEditAndContinue" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
|
2012-02-02 00:05:13 +00:00
|
|
|
--
|
|
|
|
-- Edit-and-Continue is not supported for optimized builds.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.debugFormat_onOptimizedBuild()
|
|
|
|
flags { "Symbols", "Optimize" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
|
2012-02-02 00:05:13 +00:00
|
|
|
--
|
|
|
|
-- Edit-and-Continue is not supported for Managed builds.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.debugFormat_onManagedCode()
|
|
|
|
flags { "Symbols", "Managed" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of forced includes.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.forcedIncludeFiles()
|
|
|
|
forceincludes { "stdafx.h", "include/sys.h" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
2013-03-12 23:26:25 +00:00
|
|
|
<ForcedIncludeFiles>stdafx.h;include\sys.h</ForcedIncludeFiles>
|
2012-11-06 21:42:44 +00:00
|
|
|
]]
|
|
|
|
end
|
2012-12-11 16:17:43 +00:00
|
|
|
|
2013-02-20 14:57:37 +00:00
|
|
|
function suite.forcedUsingFiles()
|
|
|
|
forceusings { "stdafx.h", "include/sys.h" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
2013-03-12 23:26:25 +00:00
|
|
|
<ForcedUsingFiles>stdafx.h;include\sys.h</ForcedUsingFiles>
|
2013-02-20 14:57:37 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-12-11 16:17:43 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of the NoRuntimeChecks flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onNoRuntimeChecks()
|
|
|
|
flags { "NoRuntimeChecks" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
|
|
|
]]
|
|
|
|
end
|
2013-02-08 15:35:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of the EnableMultiProcessorCompile flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onMultiProcessorCompile()
|
|
|
|
flags { "MultiProcessorCompile" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<MinimalRebuild>false</MinimalRebuild>
|
|
|
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
|
|
]]
|
|
|
|
end
|
2013-03-27 15:12:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of the ReleaseRuntime flag; should override the
|
|
|
|
-- default behavior of linking the debug runtime when symbols are
|
|
|
|
-- enabled with no optimizations.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.releaseRuntime_onStaticAndReleaseRuntime()
|
|
|
|
flags { "Symbols", "ReleaseRuntime", "StaticRuntime" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<ClCompile>
|
|
|
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
|
|
<WarningLevel>Level3</WarningLevel>
|
|
|
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
|
|
|
<ProgramDataBaseFileName>$(OutDir)MyProject.pdb</ProgramDataBaseFileName>
|
|
|
|
<Optimization>Disabled</Optimization>
|
|
|
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
|
|
|
]]
|
|
|
|
end
|