Add base for menu parsing unit tests

This commit is contained in:
Jan
2021-11-14 12:46:13 +01:00
parent 13589fd43c
commit 0033ab2a2b
19 changed files with 288 additions and 9 deletions

52
test/ParserTestUtils.lua Normal file
View File

@ -0,0 +1,52 @@
ParserTestUtils = {}
function ParserTestUtils:include(includes)
if includes:handle(self:name()) then
includedirs {
path.join(TestFolder(), "ParserTestUtils")
}
end
end
function ParserTestUtils:link(links)
links:add(self:name())
links:linkto(Parser)
end
function ParserTestUtils:use()
end
function ParserTestUtils:name()
return "ParserTestUtils"
end
function ParserTestUtils:project()
local folder = TestFolder()
local includes = Includes:create()
local links = Links:create()
project(self:name())
targetdir(TargetDirectoryTest)
location "%{wks.location}/test/%{prj.name}"
kind "StaticLib"
language "C++"
files {
path.join(folder, "ParserTestUtils/**.h"),
path.join(folder, "ParserTestUtils/**.cpp")
}
vpaths {
["*"] = {
path.join(folder, "ParserTestUtils")
}
}
self:include(includes)
Parser:include(includes)
catch2:include(includes)
links:linkto(Parser)
links:linkall()
end