--
-- tests/actions/vstudio/vc200x/test_files.lua
-- Validate generation of block in Visual Studio 200x projects.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
T.vstudio_vs200x_files = { }
local suite = T.vstudio_vs200x_files
local vc200x = premake.vstudio.vc200x
--
-- Setup
--
local sln, prj
function suite.setup()
sln = test.createsolution()
end
local function prepare()
premake.bake.buildconfigs()
prj = premake.solution.getproject(sln, 1)
sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
vc200x.Files(prj)
end
--
-- Test grouping and nesting
--
function suite.SimpleSourceFile()
files { "hello.cpp" }
prepare()
test.capture [[
]]
end
function suite.SingleFolderLevel()
files { "src/hello.cpp" }
prepare()
test.capture [[
]]
end
function suite.MultipleFolderLevels()
files { "src/greetings/hello.cpp" }
prepare()
test.capture [[
]]
end
--
-- Non-source code files, such as header files and documentation, should
-- be marked as such, so the compiler won't attempt to build them.
--
function suite.file_markedAsNonBuildable_onSupportFiles()
language "c"
files { "hello.lua" }
prepare()
test.capture [[
]]
end
--
-- Mixed language support
--
function suite.CompileAsC_InCppProject()
language "c++"
files { "hello.c" }
prepare()
test.capture [[
]]
end
function suite.CompileAsCpp_InCProject()
language "c"
files { "hello.cpp" }
prepare()
test.capture [[
]]
end
--
-- PCH support
--
function suite.OnPCH_OnWindows()
files { "afxwin.cpp" }
pchsource "afxwin.cpp"
prepare()
test.capture [[
]]
end
function suite.Files_OnPCH_OnXbox360()
files { "afxwin.cpp" }
pchsource "afxwin.cpp"
platforms { "Xbox360" }
prepare()
test.capture [[
]]
end