premake/tests/test_premake.lua

38 lines
676 B
Lua
Raw Permalink 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 suite.generate_ClosesFile()
2015-08-28 20:16:14 +00:00
p.generate(prj, ".prj", function () end)
test.closedfile(true)
end