premake/tests/test_premake.lua

38 lines
680 B
Lua
Raw Normal View History

--
-- tests/test_premake.lua
-- Automated test suite for the Premake support functions.
2015-08-28 20:16:14 +00:00
-- Copyright (c) 2008-2015 Jason Perkins and the Premake project
--
2015-08-28 20:16:14 +00:00
local suite = test.declare("premake")
local p = premake
--
-- Setup
--
2015-08-28 20:16:14 +00:00
local wks, prj
function suite.setup()
2015-08-28 20:16:14 +00:00
wks = test.createWorkspace()
location "MyLocation"
2015-08-28 20:16:14 +00:00
prj = p.workspace.getproject(wks, 1)
end
--
-- generate() tests
--
function suite.generate_OpensCorrectFile()
2015-08-28 20:16:14 +00:00
p.generate(prj, ".prj", function () end)
test.openedfile(path.join(os.getcwd(), "MyLocation/MyProject.prj"))
end
function T.premake.generate_ClosesFile()
2015-08-28 20:16:14 +00:00
p.generate(prj, ".prj", function () end)
test.closedfile(true)
end