2011-11-19 21:50:50 +00:00
|
|
|
--
|
|
|
|
-- tests/actions/vstudio/vc200x/test_compiler_block.lua
|
2012-02-11 13:18:19 +00:00
|
|
|
-- Validate generation the VCCLCompiler element in Visual Studio 200x C/C++ projects.
|
2013-02-08 15:35:14 +00:00
|
|
|
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
|
2011-11-19 21:50:50 +00:00
|
|
|
--
|
|
|
|
|
2013-02-08 15:35:14 +00:00
|
|
|
local suite = test.declare("vs200x_compiler_block")
|
2011-11-19 21:50:50 +00:00
|
|
|
local vc200x = premake.vstudio.vc200x
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Setup/teardown
|
|
|
|
--
|
|
|
|
|
2012-01-20 00:14:18 +00:00
|
|
|
local sln, prj, cfg
|
2011-11-19 21:50:50 +00:00
|
|
|
|
|
|
|
function suite.setup()
|
|
|
|
_ACTION = "vs2008"
|
|
|
|
sln, prj = test.createsolution()
|
|
|
|
end
|
|
|
|
|
|
|
|
local function prepare()
|
2013-09-13 15:15:36 +00:00
|
|
|
cfg = premake.project.getconfig(prj, "Debug")
|
2013-03-07 15:45:33 +00:00
|
|
|
vc200x.VCCLCompilerTool(cfg)
|
2011-11-19 21:50:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the basic structure of the compiler block with no flags or settings.
|
|
|
|
--
|
|
|
|
|
2012-01-18 00:04:46 +00:00
|
|
|
function suite.looksGood_onDefaultSettings()
|
2011-11-19 21:50:50 +00:00
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2011-11-19 21:50:50 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-01-27 01:40:39 +00:00
|
|
|
--
|
|
|
|
-- If include directories are specified, the <AdditionalIncludeDirectories> should be added.
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
function suite.additionalIncludeDirs_onIncludeDirs()
|
|
|
|
includedirs { "include/lua", "include/zlib" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
AdditionalIncludeDirectories="include\lua;include\zlib"
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-11-19 21:50:50 +00:00
|
|
|
--
|
|
|
|
-- Verify the handling of the Symbols flag. The format must be set, and the
|
|
|
|
-- debug runtime library must be selected.
|
|
|
|
--
|
|
|
|
|
2012-01-18 00:04:46 +00:00
|
|
|
function suite.looksGood_onSymbolsFlag()
|
2011-11-19 21:50:50 +00:00
|
|
|
flags "Symbols"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
MinimalRebuild="true"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="3"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2011-11-19 21:50:50 +00:00
|
|
|
DebugInformationFormat="4"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the handling of the Symbols in conjunction with the Optimize flag.
|
|
|
|
-- The release runtime library must be used.
|
|
|
|
--
|
|
|
|
|
2012-01-18 00:04:46 +00:00
|
|
|
function suite.looksGood_onSymbolsAndOptimizeFlags()
|
2011-11-19 21:50:50 +00:00
|
|
|
flags { "Symbols", "Optimize" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="3"
|
|
|
|
StringPooling="true"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2011-11-19 21:50:50 +00:00
|
|
|
DebugInformationFormat="3"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the handling of the C7 debug information format.
|
|
|
|
--
|
|
|
|
|
2012-01-18 00:04:46 +00:00
|
|
|
function suite.looksGood_onC7DebugFormat()
|
2011-11-19 21:50:50 +00:00
|
|
|
flags "Symbols"
|
|
|
|
debugformat "C7"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="3"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2011-11-19 21:50:50 +00:00
|
|
|
DebugInformationFormat="1"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
2012-01-18 00:04:46 +00:00
|
|
|
|
|
|
|
|
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-18 00:04:46 +00:00
|
|
|
|
|
|
|
function suite.compilerBlock_OnPCH()
|
2013-08-11 18:27:17 +00:00
|
|
|
location "build"
|
|
|
|
pchheader "include/common.h"
|
2012-01-18 00:04:46 +00:00
|
|
|
pchsource "source/common.cpp"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="2"
|
2013-08-11 18:27:17 +00:00
|
|
|
PrecompiledHeaderThrough="include/common.h"
|
2012-01-18 00:04:46 +00:00
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Floating point flag tests
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.compilerBlock_OnFpFast()
|
|
|
|
flags { "FloatFast" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
FloatingPointModel="2"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.compilerBlock_OnFpStrict()
|
|
|
|
flags { "FloatStrict" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
FloatingPointModel="1"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify that the PDB file uses the target name if specified.
|
|
|
|
--
|
|
|
|
|
2012-11-06 21:42:44 +00:00
|
|
|
function suite.pdbUsesTargetName_onTargetName()
|
2012-01-18 00:04:46 +00:00
|
|
|
targetname "foob"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\foob.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check that the "minimal rebuild" flag is applied correctly.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.minimalRebuildFlagsSet_onMinimalRebuildAndSymbols()
|
|
|
|
flags { "Symbols", "NoMinimalRebuild" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="3"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="4"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2013-08-15 22:22:23 +00:00
|
|
|
--
|
|
|
|
-- Check that the "no buffer security check" flag is applied correctly.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.noBufferSecurityFlagSet_onBufferSecurityCheck()
|
|
|
|
flags { "NoBufferSecurityCheck" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
BufferSecurityCheck="false"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
|
|
|
WarningLevel="3"
|
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
2012-01-18 00:04:46 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check that the CompileAs value is set correctly for C language projects.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.compileAsSet_onC()
|
|
|
|
language "C"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
CompileAs="1"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the correct runtime library is used when symbols are enabled.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onSymbolsNoOptimize()
|
|
|
|
flags { "Symbols" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
MinimalRebuild="true"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="3"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="4"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-04-11 03:29:16 +00:00
|
|
|
--
|
|
|
|
-- Verify the correct warnings settings are used when ExtraWarnings are enabled.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onExtraWarnings()
|
|
|
|
flags { "ExtraWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="4"
|
2012-04-11 03:29:16 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the correct warnings settings are used when FatalWarnings are enabled.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onFatalWarnings()
|
|
|
|
flags { "FatalWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
2012-05-10 21:52:28 +00:00
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-04-11 03:29:16 +00:00
|
|
|
WarningLevel="3"
|
|
|
|
WarnAsError="true"
|
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the correct warnings settings are used when NoWarnings are enabled.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onNoWarnings_whichDisablesAllOtherWarningsFlags()
|
|
|
|
flags { "NoWarnings", "ExtraWarnings", "FatalWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="0"
|
2012-04-11 03:29:16 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the correct Detect64BitPortabilityProblems settings are used when _ACTION < "VS2008".
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onVS2005()
|
|
|
|
_ACTION = "vs2005"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
2012-05-10 21:52:28 +00:00
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-04-11 03:29:16 +00:00
|
|
|
WarningLevel="3"
|
|
|
|
Detect64BitPortabilityProblems="true"
|
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify the correct warnings settings are used when NoWarnings are enabled.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.runtimeLibraryIsDebug_onVS2005_NoWarnings()
|
|
|
|
_ACTION = "vs2005"
|
|
|
|
flags { "NoWarnings" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="0"
|
2012-04-11 03:29:16 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-01-18 00:04:46 +00:00
|
|
|
--
|
2012-02-11 13:18:19 +00:00
|
|
|
-- Xbox 360 uses the same structure, but changes the element name.
|
2012-01-18 00:04:46 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
function suite.looksGood_onXbox360()
|
|
|
|
system "Xbox360"
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLX360CompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
2012-05-10 21:52:28 +00:00
|
|
|
WarningLevel="3"
|
2012-01-18 00:04:46 +00:00
|
|
|
DebugInformationFormat="0"
|
|
|
|
/>
|
|
|
|
]]
|
|
|
|
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 [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
|
|
|
WarningLevel="3"
|
|
|
|
DebugInformationFormat="0"
|
2013-03-27 15:12:37 +00:00
|
|
|
ForcedIncludeFiles="stdafx.h;include\sys.h"
|
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 [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
EnableFunctionLevelLinking="true"
|
|
|
|
UsePrecompiledHeader="0"
|
|
|
|
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
|
|
|
|
WarningLevel="3"
|
|
|
|
DebugInformationFormat="0"
|
2013-03-27 15:12:37 +00:00
|
|
|
ForcedUsingFiles="stdafx.h;include\sys.h"
|
2013-02-20 14:57:37 +00:00
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
2012-12-11 16:17:43 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Verify handling of the NoRuntimeChecks flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onNoRuntimeChecks()
|
|
|
|
flags { "NoRuntimeChecks" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
]]
|
|
|
|
end
|
2013-02-08 15:35:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Check handling of the EnableMultiProcessorCompile flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.onMultiProcessorCompile()
|
|
|
|
flags { "MultiProcessorCompile" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
AdditionalOptions="/MP"
|
|
|
|
Optimization="0"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
]]
|
|
|
|
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_onFlag()
|
|
|
|
flags { "Symbols", "ReleaseRuntime" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
MinimalRebuild="true"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="2"
|
|
|
|
]]
|
|
|
|
end
|
|
|
|
|
|
|
|
function suite.releaseRuntime_onStaticAndReleaseRuntime()
|
|
|
|
flags { "Symbols", "ReleaseRuntime", "StaticRuntime" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
MinimalRebuild="true"
|
|
|
|
BasicRuntimeChecks="3"
|
|
|
|
RuntimeLibrary="0"
|
|
|
|
]]
|
|
|
|
end
|
2013-08-21 09:58:08 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Check the LinkTimeOptimization flag.
|
|
|
|
--
|
|
|
|
|
|
|
|
function suite.flags_onLinkTimeOptimization()
|
|
|
|
flags { "LinkTimeOptimization" }
|
|
|
|
prepare()
|
|
|
|
test.capture [[
|
|
|
|
<Tool
|
|
|
|
Name="VCCLCompilerTool"
|
|
|
|
Optimization="0"
|
|
|
|
WholeProgramOptimization="true"
|
|
|
|
]]
|
|
|
|
|
|
|
|
end
|