-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathproject_lib_test.lua
More file actions
45 lines (33 loc) · 1.04 KB
/
project_lib_test.lua
File metadata and controls
45 lines (33 loc) · 1.04 KB
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
--
-- Zidar - Build system scripts
-- Copyright (c) 2025-2026 Milos Tosic, Rudji Games. All rights reserved.
-- License: https://github.com/RudjiGames/zidar/blob/master/LICENSE
--
function addProject_lib_test(_name)
group ( "tests" )
project ( _name .. "_test" )
project().kind = "ConsoleApp"
kind ( project().kind )
uuid ( os.uuid(project().name) )
flags { Flags_Tests }
local projectPath = projectGetPath(_name)
local projectPathTests = projectPath .. "/tests"
local incFilesPath = projectGetIncludePath(projectPath)
includedirs { incFilesPath,
projectPathTests }
local sourceFiles = projectSourceFilesWildcard(projectPathTests)
local isCPP = projectIsCPP(sourceFiles)
if isCPP then
language "C++"
else
language "C"
end
files { sourceFiles }
addPCH( projectPathTests, project().name )
projectConfig()
if isCPP then
addDependencies(project().name, { "unittest-cpp", _name })
else
addDependencies(project().name, { "unity", _name }) -- NB: unity is a C unit testing framework,
end
end