forked from bkaradzic/GENie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_project.lua
64 lines (49 loc) · 1.36 KB
/
test_project.lua
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--
-- 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
--
-- getfilename() tests
--
function T.project.getfilename_ReturnsRelativePath()
local prj = { name = "project", location = "location" }
local r = _project.getfilename(prj, path.join(os.getcwd(), "../filename"))
test.isequal("../filename", r)
end
function T.project.getfilename_PerformsSubstitutions()
local prj = { name = "project", location = "location" }
local r = _project.getfilename(prj, "%%.prj")
test.isequal("location/project.prj", r)
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