Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2011-12-14 01:10:22 +0400
committerJason Perkins <starkos@industriousone.com>2011-12-14 01:10:22 +0400
commitf6cf8cf90548c73e0806f5ecd3385c22e084efc5 (patch)
treec7d9606c27d75a4e427cb6840e2a2d51c753d1f8 /tests
parent090384b603afbcf8605552f00923a1eeea1498bd (diff)
Patch 3451212: Fix Visual Studio MFC with StaticRuntime
Diffstat (limited to 'tests')
-rw-r--r--tests/actions/vstudio/test_vs200x_vcproj.lua21
-rw-r--r--tests/actions/vstudio/vc200x/test_mfc.lua64
-rw-r--r--tests/actions/vstudio/vc2010/test_mfc.lua60
-rw-r--r--tests/premake4.lua2
4 files changed, 126 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
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