-- -- 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" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" project "DotNetProject" -- to test handling of .NET platform in solution language "C#" kind "ConsoleApp" _ACTION = 'vs2005' end local function prepare() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) 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 [[ ]] end -- -- Test multiple platforms -- function T.vs200x_vcproj.Platforms_OnMultiplePlatforms() platforms { "x32", "x64" } prepare() premake.vs200x_vcproj(prj) local result = io.endcapture() test.istrue(result:find ' ]] end -- -- Test PS3 handling -- function T.vs200x_vcproj.PlatformsList_OnPS3() platforms { "Native", "PS3" } prepare() premake.vs200x_vcproj_platforms(prj) test.capture [[ ]] end