diff options
author | starkos <none@none> | 2009-03-26 02:04:32 +0300 |
---|---|---|
committer | starkos <none@none> | 2009-03-26 02:04:32 +0300 |
commit | 0776e56996fa3f25d4f746bd05e3b6badc339644 (patch) | |
tree | ea6684aac212f4e1ec9fe879f7067e90a090f66a /tests | |
parent | d61caeb2c8758558969876e1d507d3f73efbfc31 (diff) |
** Merged branches/platforms (r735:741) Added x32 and x64 platform support for VS2005 and 2008
Diffstat (limited to 'tests')
-rw-r--r-- | tests/premake4.lua | 5 | ||||
-rw-r--r-- | tests/test_vs2002_sln.lua | 59 | ||||
-rw-r--r-- | tests/test_vs2003_sln.lua | 59 | ||||
-rw-r--r-- | tests/test_vs2005_sln.lua | 208 | ||||
-rw-r--r-- | tests/test_vs2008_sln.lua | 58 | ||||
-rw-r--r-- | tests/test_vs200x_vcproj.lua | 264 | ||||
-rw-r--r-- | tests/testfx.lua | 20 |
7 files changed, 673 insertions, 0 deletions
diff --git a/tests/premake4.lua b/tests/premake4.lua index 02b7ac2..4230802 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -16,6 +16,11 @@ dofile("test_api.lua") dofile("test_targets.lua") dofile("test_keywords.lua") + dofile("test_vs2002_sln.lua") + dofile("test_vs2003_sln.lua") + dofile("test_vs2005_sln.lua") + dofile("test_vs2008_sln.lua") + dofile("test_vs200x_vcproj.lua") diff --git a/tests/test_vs2002_sln.lua b/tests/test_vs2002_sln.lua new file mode 100644 index 0000000..6018802 --- /dev/null +++ b/tests/test_vs2002_sln.lua @@ -0,0 +1,59 @@ +-- +-- tests/test_vs2002_sln.lua +-- Automated test suite for Visual Studio 2002 solution generation. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.vs2002_sln = { } + +-- +-- Configure a solution for testing +-- + + local sln + function T.vs2002_sln.setup() + sln = solution "MySolution" + configurations { "Debug", "Release" } + + prj = project "MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + + premake.buildconfigs() + _ACTION = 'vs2002' + end + + + +-- +-- Make sure I've got the basic layout correct +-- + + function T.vs2002_sln.BasicLayout() + io.capture() + premake.vs2002_solution(sln) + test.capture [[ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal + ]] + end diff --git a/tests/test_vs2003_sln.lua b/tests/test_vs2003_sln.lua new file mode 100644 index 0000000..afc624a --- /dev/null +++ b/tests/test_vs2003_sln.lua @@ -0,0 +1,59 @@ +-- +-- tests/test_vs2003_sln.lua +-- Automated test suite for Visual Studio 2003 solution generation. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.vs2003_sln = { } + +-- +-- Configure a solution for testing +-- + + local sln + function T.vs2003_sln.setup() + sln = solution "MySolution" + configurations { "Debug", "Release" } + + prj = project "MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + + premake.buildconfigs() + _ACTION = 'vs2003' + end + + + +-- +-- Make sure I've got the basic layout correct +-- + + function T.vs2003_sln.BasicLayout() + io.capture() + premake.vs2003_solution(sln) + test.capture [[ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal + ]] + end diff --git a/tests/test_vs2005_sln.lua b/tests/test_vs2005_sln.lua new file mode 100644 index 0000000..2d0e07c --- /dev/null +++ b/tests/test_vs2005_sln.lua @@ -0,0 +1,208 @@ +-- +-- tests/test_vs2005_sln.lua +-- Automated test suite for Visual Studio 2005 solution generation. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.vs2005_sln = { } + +-- +-- Configure a solution for testing +-- + + local sln + function T.vs2005_sln.setup() + sln = solution "MySolution" + configurations { "Debug", "Release" } + + prj = project "MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + + _ACTION = 'vs2005' + end + + + +-- +-- Make sure I've got the basic layout correct +-- + + function T.vs2005_sln.BasicLayout() + io.capture() + premake.buildconfigs() + premake.vs2005_solution(sln) + test.capture ('\239\187\191' .. [[ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal + ]]) + end + + + +-- +-- Test a mixed runtime (C++/.NET) solution. +-- + + function T.vs2005_sln.MixedRuntime() + project "MyNetProject" + language "C#" + kind "ConsoleApp" + uuid "C9135098-6047-8142-B10E-D27E7F73FCB3" + + io.capture() + premake.buildconfigs() + premake.vs2005_solution(sln) + test.capture ('\239\187\191' .. [[ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyNetProject", "MyNetProject.csproj", "{C9135098-6047-8142-B10E-D27E7F73FCB3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal + ]]) + end + + +-- +-- Test combinations of C++ and .NET platforms +-- + + function T.vs2005_sln.SolutionConfigs_OnMultipleCppPlatforms() + solution() + platforms { "x32", "x64" } + + io.capture() + premake.buildconfigs() + premake.vs2005_solution_configurations(sln) + test.capture [[ + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + ]] + end + + + function T.vs2005_sln.ProjectConfigs_OnMultipleCppPlatforms() + solution() + platforms { "x32", "x64" } + + io.capture() + premake.buildconfigs() + premake.vs2005_solution_project_configurations(sln) + test.capture [[ + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.ActiveCfg = Debug|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.Build.0 = Debug|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.ActiveCfg = Release|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + ]] + end + + + function T.vs2005_sln.ProjectConfigs_OnMultipleCppPlatformsAndMixedRuntimes() + project "MyNetProject" + language "C#" + kind "ConsoleApp" + uuid "C9135098-6047-8142-B10E-D27E7F73FCB3" + + solution() + platforms { "x32", "x64" } + + io.capture() + premake.buildconfigs() + premake.vs2005_solution_project_configurations(sln) + test.capture [[ + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.ActiveCfg = Debug|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|x64.Build.0 = Debug|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Any CPU.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Mixed Platforms.Build.0 = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.ActiveCfg = Release|x64 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|x64.Build.0 = Release|x64 + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Any CPU.Build.0 = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|Win32.ActiveCfg = Release|Any CPU + {C9135098-6047-8142-B10E-D27E7F73FCB3}.Release|x64.ActiveCfg = Release|Any CPU + EndGlobalSection + ]] + end diff --git a/tests/test_vs2008_sln.lua b/tests/test_vs2008_sln.lua new file mode 100644 index 0000000..74ec803 --- /dev/null +++ b/tests/test_vs2008_sln.lua @@ -0,0 +1,58 @@ +-- +-- tests/test_vs2008_sln.lua +-- Automated test suite for Visual Studio 2008 solution generation. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.vs2008_sln = { } + +-- +-- Configure a solution for testing +-- + + local sln + function T.vs2008_sln.setup() + sln = solution "MySolution" + configurations { "Debug", "Release" } + + prj = project "MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + + premake.buildconfigs() + _ACTION = 'vs2008' + end + + + +-- +-- Make sure I've got the basic layout correct +-- + + function T.vs2008_sln.BasicLayout() + io.capture() + premake.vs2005_solution(sln) + test.capture ('\239\187\191' .. [[ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32 + {AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal + ]]) + end diff --git a/tests/test_vs200x_vcproj.lua b/tests/test_vs200x_vcproj.lua new file mode 100644 index 0000000..4e0da1a --- /dev/null +++ b/tests/test_vs200x_vcproj.lua @@ -0,0 +1,264 @@ +-- +-- tests/test_vs200x_vcproj.lua +-- Automated test suite for Visual Studio 2002-2008 C/C++ project generation. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.vs200x_vcproj = { } + +-- +-- Configure a solution for testing +-- + + local sln, prj + function T.vs200x_vcproj.setup() + sln = solution "MySolution" + configurations { "Debug", "Release" } + + prj = project "MyProject" + language "C++" + kind "ConsoleApp" + uuid "AE61726D-187C-E440-BD07-2556188A6565" + + _ACTION = 'vs2005' + end + + local function prepare() + io.capture() + premake.buildconfigs() + + local cfg = premake.getconfig(sln.projects[1]) + cfg.name = prj.name + cfg.blocks = prj.blocks + prj = cfg + end + + +-- +-- Make sure I've got the basic layout correct +-- + + function T.vs200x_vcproj.BasicLayout() + prepare() + premake.vs200x_vcproj(prj) + test.capture [[ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="MyProject" + ProjectGUID="{AE61726D-187C-E440-BD07-2556188A6565}" + RootNamespace="MyProject" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="." + IntermediateDirectory="obj\Debug" + ConfigurationType="1" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb" + DebugInformationFormat="0" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\MyProject.exe" + LinkIncremental="2" + AdditionalLibraryDirectories="" + GenerateDebugInformation="false" + SubSystem="1" + EntryPointSymbol="mainCRTStartup" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="." + IntermediateDirectory="obj\Release" + ConfigurationType="1" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb" + DebugInformationFormat="0" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\MyProject.exe" + LinkIncremental="2" + AdditionalLibraryDirectories="" + GenerateDebugInformation="false" + SubSystem="1" + EntryPointSymbol="mainCRTStartup" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + </Files> + <Globals> + </Globals> +</VisualStudioProject> + ]] + end + + +-- +-- Test multiple platforms +-- + + function T.vs200x_vcproj.Platforms_OnMultiplePlatforms() + platforms { "x32", "x64" } + + prepare() + premake.vs200x_vcproj_platforms(prj) + test.capture [[ + <Platforms> + <Platform + Name="Win32" + /> + <Platform + Name="x64" + /> + </Platforms> + ]] + end + + + + function T.vs200x_vcproj.Platforms_OnMultiplePlatforms() + platforms { "x32", "x64" } + + prepare() + premake.vs200x_vcproj(prj) + local result = io.endcapture() + + test.istrue(result:find '<Configuration\r\n\t\t\tName="Debug|Win32"\r\n') + test.istrue(result:find '<Configuration\r\n\t\t\tName="Release|Win32"\r\n') + test.istrue(result:find '<Configuration\r\n\t\t\tName="Debug|x64"\r\n') + test.istrue(result:find '<Configuration\r\n\t\t\tName="Release|x64"\r\n') + end diff --git a/tests/testfx.lua b/tests/testfx.lua index 7cdcce8..a135d52 100644 --- a/tests/testfx.lua +++ b/tests/testfx.lua @@ -19,6 +19,26 @@ -- Assertion functions -- + function test.capture(expected) + local actual = io.endcapture() + + local ait = actual:gfind("(.-)" .. io.eol) + local eit = expected:gfind("(.-)\n") + + local linenum = 1 + local atxt = ait() + local etxt = eit() + while etxt do + if (etxt ~= atxt) then + test.fail("(%d) expected:\n%s\n...but was:\n%s", linenum, etxt, atxt) + end + linenum = linenum + 1 + atxt = ait() + etxt = eit() + end + end + + function test.fail(format, ...) -- convert nils into something more usefuls for i = 1, arg.n do |