2008-10-31 18:38:05 +00:00
|
|
|
--
|
|
|
|
-- tests/test_premake.lua
|
|
|
|
-- Automated test suite for the Premake support functions.
|
2009-08-12 01:16:15 +00:00
|
|
|
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
|
2008-10-31 18:38:05 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
|
2012-10-24 19:40:25 +00:00
|
|
|
T.premake = {}
|
|
|
|
local suite = T.premake
|
2008-10-31 18:38:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
2012-10-24 19:40:25 +00:00
|
|
|
-- Setup
|
2008-10-31 18:38:05 +00:00
|
|
|
--
|
|
|
|
|
2012-10-24 19:40:25 +00:00
|
|
|
local sln, prj
|
|
|
|
function suite.setup()
|
|
|
|
sln = test.createsolution()
|
|
|
|
location "MyLocation"
|
2012-12-31 18:45:22 +00:00
|
|
|
prj = premake.solution.getproject_ng(sln, 1)
|
2008-10-31 18:38:05 +00:00
|
|
|
end
|
|
|
|
|
2012-12-31 18:45:22 +00:00
|
|
|
|
2009-08-12 01:16:15 +00:00
|
|
|
--
|
|
|
|
-- generate() tests
|
|
|
|
--
|
|
|
|
|
2012-10-24 19:40:25 +00:00
|
|
|
function suite.generate_OpensCorrectFile()
|
|
|
|
premake.generate(prj, ".prj", function () end)
|
|
|
|
test.openedfile(path.join(os.getcwd(), "MyLocation/MyProject.prj"))
|
2009-08-12 01:16:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function T.premake.generate_ClosesFile()
|
2012-10-24 19:40:25 +00:00
|
|
|
premake.generate(prj, ".prj", function () end)
|
2009-08-12 01:16:15 +00:00
|
|
|
test.closedfile(true)
|
|
|
|
end
|