forked from premake/premake-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_directory_kind.lua
More file actions
49 lines (38 loc) · 901 Bytes
/
Copy pathtest_directory_kind.lua
File metadata and controls
49 lines (38 loc) · 901 Bytes
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
--
-- tests/api/test_directory_kind.lua
-- Tests the directory API value type.
-- Copyright (c) 2013 Jason Perkins and the Premake project
--
local p = premake
local suite = test.declare("api_directory_kind")
local api = p.api
--
-- Setup and teardown
--
function suite.setup()
api.register {
name = "testapi",
kind = "directory",
list = true,
scope = "project"
}
test.createWorkspace()
end
function suite.teardown()
testapi = nil
end
--
-- Values should be converted to absolute paths, relative to
-- the currently running script.
--
function suite.convertsToAbsolute()
testapi "self/local"
test.isequal({os.getcwd() .. "/self/local"}, api.scope.project.testapi)
end
--
-- Check expansion of wildcards.
--
function suite.expandsWildcards()
testapi (_TESTS_DIR .. "/*")
test.istrue(table.contains(api.scope.project.testapi, _TESTS_DIR .. "/api"))
end