From f6cf8cf90548c73e0806f5ecd3385c22e084efc5 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Tue, 13 Dec 2011 16:10:22 -0500 Subject: Patch 3451212: Fix Visual Studio MFC with StaticRuntime --- tests/actions/vstudio/test_vs200x_vcproj.lua | 21 --------- tests/actions/vstudio/vc200x/test_mfc.lua | 64 ++++++++++++++++++++++++++++ tests/actions/vstudio/vc2010/test_mfc.lua | 60 ++++++++++++++++++++++++++ tests/premake4.lua | 2 + 4 files changed, 126 insertions(+), 21 deletions(-) create mode 100644 tests/actions/vstudio/vc200x/test_mfc.lua create mode 100644 tests/actions/vstudio/vc2010/test_mfc.lua (limited to 'tests') 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 @@ -235,27 +235,6 @@ end --- --- Test the element --- - - function suite.Configuration_OnMFCFlag() - flags { "MFC" } - prepare() - vc200x.Configuration("Debug|Win32", premake.getconfig(prj, "Debug")) - test.capture [[ - - ]] - 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 [[ + + ]] + end + + function suite.useOfMfc_isStatic_onStaticRuntime() + flags { "MFC", "StaticRuntime" } + prepare() + test.capture [[ + + ]] + 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 [[ + + Application + true + MultiByte + Dynamic + + ]] + end + + function suite.useOfMfc_isStatic_onStaticRuntime() + flags { "MFC", "StaticRuntime" } + prepare() + test.capture [[ + + Application + true + MultiByte + Static + + ]] + end diff --git a/tests/premake4.lua b/tests/premake4.lua index 8524d66..fa86e99 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -99,6 +99,7 @@ dofile("actions/vstudio/vc200x/header.lua") dofile("actions/vstudio/vc200x/test_files.lua") dofile("actions/vstudio/vc200x/test_filters.lua") + dofile("actions/vstudio/vc200x/test_mfc.lua") -- Visual Studio 2010 C/C++ projects dofile("actions/vstudio/vc2010/test_debugdir.lua") @@ -107,6 +108,7 @@ dofile("actions/vstudio/vc2010/test_filters.lua") dofile("actions/vstudio/vc2010/test_link_settings.lua") dofile("actions/vstudio/vc2010/test_links.lua") + dofile("actions/vstudio/vc2010/test_mfc.lua") dofile("actions/vstudio/vc2010/test_pch.lua") -- Makefile tests -- cgit v1.2.3