premake/tests/test_project.lua

47 lines
922 B
Lua

--
-- tests/test_project.lua
-- Automated test suite for the project support functions.
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
local _project = premake.project
T.project = { }
local cfg, result
function T.project.setup()
_ACTION = "gmake"
cfg = {}
cfg.project = {}
cfg.language = "C++"
cfg.files = {}
cfg.trimpaths = {}
cfg.platform = "Native"
result = "\n"
end
--
-- findproject() tests
--
function T.project.findproject_IsCaseSensitive()
local sln = test.createsolution()
local prj = test.createproject(sln)
premake.bake.buildconfigs()
test.isnil(premake.findproject("myproject"))
end
--
-- premake.getlinks() tests
--
function T.project.getlinks_OnMscSystemLibs()
_OPTIONS.cc = "msc"
cfg.links = { "user32", "gdi32" }
result = premake.getlinks(cfg, "all", "fullpath")
test.isequal("user32.lib gdi32.lib", table.concat(result, " "))
end