From e1478cbb172cfb7bcb6220d154fc6f12d5e04bc6 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Thu, 25 Apr 2013 16:00:18 -0400 Subject: Add support for Visual Studio 2012 (Oliver Schneider) --- tests/actions/vstudio/cs2005/projectelement.lua | 15 ++++- tests/actions/vstudio/cs2005/projectsettings.lua | 29 ++++++++-- tests/actions/vstudio/sln2005/header.lua | 16 +++++- tests/actions/vstudio/vc2010/test_config_props.lua | 65 ++++++++++++++++++++++ tests/premake4.lua | 1 + 5 files changed, 115 insertions(+), 11 deletions(-) create mode 100644 tests/actions/vstudio/vc2010/test_config_props.lua (limited to 'tests') diff --git a/tests/actions/vstudio/cs2005/projectelement.lua b/tests/actions/vstudio/cs2005/projectelement.lua index fda6061..1d2a61f 100755 --- a/tests/actions/vstudio/cs2005/projectelement.lua +++ b/tests/actions/vstudio/cs2005/projectelement.lua @@ -10,15 +10,15 @@ -- --- Setup +-- Setup -- local sln, prj - + function suite.setup() sln = test.createsolution() end - + local function prepare() premake.bake.buildconfigs() prj = premake.solution.getproject(sln, 1) @@ -51,6 +51,15 @@ prepare() test.capture [[ + + ]] + end + + function suite.On2012() + _ACTION = "vs2012" + prepare() + test.capture [[ + ]] end diff --git a/tests/actions/vstudio/cs2005/projectsettings.lua b/tests/actions/vstudio/cs2005/projectsettings.lua index 2e2e242..f30559f 100755 --- a/tests/actions/vstudio/cs2005/projectsettings.lua +++ b/tests/actions/vstudio/cs2005/projectsettings.lua @@ -10,17 +10,17 @@ -- --- Setup +-- Setup -- local sln, prj - + function suite.setup() sln = test.createsolution() language "C#" - uuid "AE61726D-187C-E440-BD07-2556188A6565" + uuid "AE61726D-187C-E440-BD07-2556188A6565" end - + local function prepare() premake.bake.buildconfigs() prj = premake.solution.getproject(sln, 1) @@ -85,7 +85,26 @@ MyProject MyProject v4.0 - Client + + 512 + + ]] + end + + + function suite.OnVs2012() + _ACTION = "vs2012" + prepare() + test.capture [[ + + Debug + AnyCPU + {AE61726D-187C-E440-BD07-2556188A6565} + Exe + Properties + MyProject + MyProject + v4.5 512 ]] diff --git a/tests/actions/vstudio/sln2005/header.lua b/tests/actions/vstudio/sln2005/header.lua index 727bb4a..5eb02e3 100755 --- a/tests/actions/vstudio/sln2005/header.lua +++ b/tests/actions/vstudio/sln2005/header.lua @@ -10,15 +10,15 @@ -- --- Setup +-- Setup -- local sln, prj - + function suite.setup() sln = test.createsolution() end - + local function prepare() premake.bake.buildconfigs() sln2005.header() @@ -57,3 +57,13 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 ]] end + + + function suite.On2012() + _ACTION = "vs2012" + prepare() + test.capture [[ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 + ]] + end diff --git a/tests/actions/vstudio/vc2010/test_config_props.lua b/tests/actions/vstudio/vc2010/test_config_props.lua new file mode 100644 index 0000000..3aef357 --- /dev/null +++ b/tests/actions/vstudio/vc2010/test_config_props.lua @@ -0,0 +1,65 @@ +-- +-- tests/actions/vstudio/vc2010/test_config_props.lua +-- Validate generation of the configuration property group. +-- Copyright (c) 2011-2013 Jason Perkins and the Premake project +-- + + T.vstudio_vs2010_config_props = { } + local suite = T.vstudio_vs2010_config_props + local vc2010 = premake.vstudio.vc2010 + local project = premake.project + + +-- +-- Setup +-- + + local sln, prj + + function suite.setup() + sln, prj = test.createsolution() + end + + local function prepare(platform) + premake.bake.buildconfigs() + sln.vstudio_configs = premake.vstudio.buildconfigs(sln) + local cfginfo = sln.vstudio_configs[1] + local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) + vc2010.configurationPropertyGroup(cfg, cfginfo) + end + + +-- +-- Check the structure with the default project values. +-- + + function suite.structureIsCorrect_onDefaultValues() + prepare() + test.capture [[ + + Application + true + MultiByte + + ]] + end + + + + +-- +-- Visual Studio 2012 adds a platform toolset. +-- + + function suite.structureIsCorrect_onDefaultValues() + _ACTION = "vs2012" + prepare() + test.capture [[ + + Application + true + MultiByte + v110 + + ]] + end diff --git a/tests/premake4.lua b/tests/premake4.lua index 2f64d7f..b0ebde9 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -103,6 +103,7 @@ dofile("actions/vstudio/vc200x/test_mfc.lua") -- Visual Studio 2010 C/C++ projects + dofile("actions/vstudio/vc2010/test_config_props.lua") dofile("actions/vstudio/vc2010/test_debugdir.lua") dofile("actions/vstudio/vc2010/test_header.lua") dofile("actions/vstudio/vc2010/test_files.lua") -- cgit v1.2.3