---
-- codelite/tests/test_codelite_workspace.lua
-- Validate generation for CodeLite workspaces.
-- Author Manu Evans
-- Copyright (c) 2015 Manu Evans and the Premake project
---
local suite = test.declare("codelite_workspace")
local p = premake
local codelite = p.modules.codelite
--
-- Setup
--
local wks, prj
function suite.setup()
p.action.set("codelite")
p.escaper(codelite.esc)
p.indent(" ")
wks = test.createWorkspace()
end
local function prepare()
wks = test.getWorkspace(wks)
codelite.workspace.generate(wks)
end
--
-- Check the basic structure of a workspace.
--
function suite.onEmptyWorkspace()
wks.projects = {}
prepare()
test.capture [[
]]
end
function suite.onDefaultWorkspace()
prepare()
test.capture [[
]]
end
function suite.onMultipleProjects()
test.createproject(wks)
prepare()
test.capture [[
]]
end
--
-- Projects should include relative path from workspace.
--
function suite.onNestedProjectPath()
location "MyProject"
prepare()
test.capture([[
]])
end
function suite.onExternalProjectPath()
location "../MyProject"
prepare()
test.capture([[
]])
end
function suite.onActiveProject()
workspace("MyWorkspace")
startproject "MyProject"
prepare()
test.capture([[
]])
end
function suite.onGroupedProjects()
wks.projects = {}
project "MyGrouplessProject"
group "MyGroup"
project "MyGroupedProject"
group "My/Nested/Group"
project "MyNestedGroupedProject"
prepare()
test.capture([[
]])
end
---
-- Test handling of platforms
---
function suite.onPlatforms()
workspace "MyWorkspace"
platforms { "x86_64", "x86" }
prepare()
test.capture [[
]]
end