-
Notifications
You must be signed in to change notification settings - Fork 519
/
Copy pathTests.lua
144 lines (116 loc) · 3.03 KB
/
Tests.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
-- Tests/examples helpers
require('vstudio')
function SetupExampleProject()
kind "ConsoleApp"
language "C#"
debugdir "."
links { "CppSharp.Parser" }
SetupManagedProject()
end
function SetupTestProject(name, extraFiles, suffix)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjectsCSharp(name, nil, extraFiles, suffix)
SetupTestProjectsCLI(name, extraFiles, suffix)
end
function SetupTestCSharp(name)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjectsCSharp(name)
end
function SetupTestCLI(name, extraFiles, suffix)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjectsCLI(name, extraFiles, suffix)
end
function SetupManagedTestProject()
SetupManagedProject()
enabledefaultcompileitems "false"
kind "SharedLib"
language "C#"
clr "Unsafe"
files { "*.lua" }
end
function SetupExternalManagedTestProject(name)
externalproject (name)
SetupManagedTestProject()
end
function SetupTestGeneratorProject(name, depends)
if EnabledManagedProjects() then
SetupExternalManagedTestProject(name .. ".Gen")
end
end
function SetupTestNativeProject(name, depends)
if not EnableNativeProjects() then
return
end
project(name .. ".Native")
SetupNativeProject()
kind "SharedLib"
language "C++"
targetdir (path.join(gendir, name))
files { "**.h", "**.cpp" }
defines { "DLL_EXPORT" }
if depends ~= nil then
links { depends .. ".Native" }
end
end
function SetupTestProjectsCSharp(name, depends, extraFiles, suffix)
if not EnabledManagedProjects() then
return
end
if suffix ~= nil then
nm = name .. suffix
str = "Std" .. suffix
else
nm = name
str = "Std"
end
if name ~= "NamespacesDerived" then
SetupExternalManagedTestProject(name .. ".CSharp")
end
SetupExternalManagedTestProject(name .. ".Tests.CSharp")
end
function SetupTestProjectsCLI(name, extraFiles, suffix)
if not EnabledCLIProjects() then
return
end
project(name .. ".CLI")
SetupNativeProject()
kind "SharedLib"
language "C++"
clr "NetCore"
targetdir (path.join(gendir, name))
dependson { name .. ".Gen" }
if (suffix ~= nil) then
nm = name .. suffix
else
nm = name
end
files
{
path.join(gendir, name, nm .. ".cpp"),
path.join(gendir, name, nm .. ".h")
}
if extraFiles ~= nil then
for _, file in pairs(extraFiles) do
if suffix ~= nil then
file = file .. suffix
end
files { path.join(gendir, name, file .. ".cpp") }
files { path.join(gendir, name, file .. ".h") }
end
end
includedirs { path.join(testsdir, name), incdir }
links { name .. ".Native" }
files { path.join(objsdir, name .. ".Native") }
SetupExternalManagedTestProject(name .. ".Tests.CLI")
end
function IncludeExamples()
--print("Searching for examples...")
IncludeDir(examplesdir)
end
function IncludeTests()
--print("Searching for tests...")
IncludeDir(testsdir)
end