blob: 552f9558c654a451a2703d5ad75ef994f07fe3ce (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
--
-- tests/test_premake.lua
-- Automated test suite for the Premake support functions.
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
--
T.premake = { }
--
-- premake.checktools() tests
--
function T.premake.checktools_SetsDefaultTools()
_ACTION = "gmake"
premake.checktools()
test.isequal("gcc", _OPTIONS.cc)
test.isequal("mono", _OPTIONS.dotnet)
end
function T.premake.checktools_Fails_OnToolMismatch()
_ACTION = "gmake"
_OPTIONS["cc"] = "xyz"
ok, err = premake.checktools()
test.isfalse( ok )
test.isequal("the GNU Make action does not support /cc=xyz (yet)", err)
end
--
-- generate() tests
--
function T.premake.generate_OpensCorrectFile()
prj = { name = "MyProject", location = "MyLocation" }
premake.generate(prj, "%%.prj", function () end)
test.openedfile("MyLocation/MyProject.prj")
end
function T.premake.generate_ClosesFile()
prj = { name = "MyProject", location = "MyLocation" }
premake.generate(prj, "%%.prj", function () end)
test.closedfile(true)
end
|