diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-12-14 01:10:22 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-12-14 01:10:22 +0400 |
commit | f6cf8cf90548c73e0806f5ecd3385c22e084efc5 (patch) | |
tree | c7d9606c27d75a4e427cb6840e2a2d51c753d1f8 /tests/actions | |
parent | 090384b603afbcf8605552f00923a1eeea1498bd (diff) |
Patch 3451212: Fix Visual Studio MFC with StaticRuntime
Diffstat (limited to 'tests/actions')
-rw-r--r-- | tests/actions/vstudio/test_vs200x_vcproj.lua | 21 | ||||
-rw-r--r-- | tests/actions/vstudio/vc200x/test_mfc.lua | 64 | ||||
-rw-r--r-- | tests/actions/vstudio/vc2010/test_mfc.lua | 60 |
3 files changed, 124 insertions, 21 deletions
diff --git a/tests/actions/vstudio/test_vs200x_vcproj.lua b/tests/actions/vstudio/test_vs200x_vcproj.lua index 1e0f1e6..5bc06af 100644 --- a/tests/actions/vstudio/test_vs200x_vcproj.lua +++ b/tests/actions/vstudio/test_vs200x_vcproj.lua @@ -236,27 +236,6 @@ -- --- Test the <Configuration> element --- - - function suite.Configuration_OnMFCFlag() - flags { "MFC" } - prepare() - vc200x.Configuration("Debug|Win32", premake.getconfig(prj, "Debug")) - test.capture [[ - <Configuration - Name="Debug|Win32" - OutputDirectory="." - IntermediateDirectory="obj\Debug\MyProject" - ConfigurationType="1" - UseOfMFC="2" - CharacterSet="2" - > - ]] - end - - --- -- Test multiple platforms -- diff --git a/tests/actions/vstudio/vc200x/test_mfc.lua b/tests/actions/vstudio/vc200x/test_mfc.lua new file mode 100644 index 0000000..ea0671e --- /dev/null +++ b/tests/actions/vstudio/vc200x/test_mfc.lua @@ -0,0 +1,64 @@ +-- +-- tests/actions/vstudio/vc200x/test_mfc.lua +-- Validate MFC support in Visual Studio 200x C/C++ projects. +-- Copyright (c) 2011 Jason Perkins and the Premake project +-- + + T.vstudio_vs200x_mfc = { } + local suite = T.vstudio_vs200x_mfc + local vc200x = premake.vstudio.vc200x + + +-- +-- Setup +-- + + local sln, prj, cfg + + function suite.setup() + _ACTION = "vs2008" + sln, prj = test.createsolution() + end + + local function prepare(platform) + premake.bake.buildconfigs() + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) + cfg = premake.getconfig(prj, "Debug", platform) + vc200x.Configuration("Debug|Win32", cfg) + end + + +-- +-- When MFC is enabled, it should match the runtime library linking +-- method (static or dynamic). +-- + + function suite.useOfMfc_isDynamic_onSharedRuntime() + flags { "MFC" } + prepare() + test.capture [[ + <Configuration + Name="Debug|Win32" + OutputDirectory="." + IntermediateDirectory="obj\Debug" + ConfigurationType="1" + UseOfMFC="2" + CharacterSet="2" + > + ]] + end + + function suite.useOfMfc_isStatic_onStaticRuntime() + flags { "MFC", "StaticRuntime" } + prepare() + test.capture [[ + <Configuration + Name="Debug|Win32" + OutputDirectory="." + IntermediateDirectory="obj\Debug" + ConfigurationType="1" + UseOfMFC="1" + CharacterSet="2" + > + ]] + end diff --git a/tests/actions/vstudio/vc2010/test_mfc.lua b/tests/actions/vstudio/vc2010/test_mfc.lua new file mode 100644 index 0000000..6a8555d --- /dev/null +++ b/tests/actions/vstudio/vc2010/test_mfc.lua @@ -0,0 +1,60 @@ +-- +-- tests/actions/vstudio/vc2010/test_mfc.lua +-- Validate MFC support in Visual Studio 2010 C/C++ projects. +-- Copyright (c) 2011 Jason Perkins and the Premake project +-- + + T.vstudio_vs2010_mfc = { } + local suite = T.vstudio_vs2010_mfc + local vc2010 = premake.vstudio.vc2010 + + +-- +-- Setup +-- + + local sln, prj, cfg + + function suite.setup() + _ACTION = "vs2010" + sln, prj = test.createsolution() + end + + local function prepare(platform) + premake.bake.buildconfigs() + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) + cfg = premake.getconfig(prj, "Debug", platform) + vc2010.configurationPropertyGroup(cfg) + end + + +-- +-- When MFC is enabled, it should match the runtime library linking +-- method (static or dynamic). +-- + + function suite.useOfMfc_isDynamic_onSharedRuntime() + flags { "MFC" } + prepare() + test.capture [[ + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>MultiByte</CharacterSet> + <UseOfMfc>Dynamic</UseOfMfc> + </PropertyGroup> + ]] + end + + function suite.useOfMfc_isStatic_onStaticRuntime() + flags { "MFC", "StaticRuntime" } + prepare() + test.capture [[ + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>MultiByte</CharacterSet> + <UseOfMfc>Static</UseOfMfc> + </PropertyGroup> + ]] + end |