Browse Source

Improved the tests-related build system scripts.

pull/1/head
triton 13 years ago
parent
commit
6d02e8bb7d
  1. 3
      build/Helpers.lua
  2. 87
      build/Tests.lua

3
build/Helpers.lua

@ -4,13 +4,14 @@ action = _ACTION or "" @@ -4,13 +4,14 @@ action = _ACTION or ""
depsdir = path.getabsolute("../deps");
srcdir = path.getabsolute("../src");
incdir = path.getabsolute("../inc");
incdir = path.getabsolute("../include");
bindir = path.getabsolute("../bin");
examplesdir = path.getabsolute("../examples");
testsdir = path.getabsolute("../tests");
builddir = path.getabsolute("./" .. action);
libdir = path.join(builddir, "lib");
gendir = path.join(builddir, "gen");
common_flags = { "Unicode", "Symbols" }
msvc_buildflags = { } -- "/wd4190", "/wd4996", "/wd4530"

87
build/Tests.lua

@ -5,15 +5,20 @@ function SetupExampleProject() @@ -5,15 +5,20 @@ function SetupExampleProject()
location (path.join(builddir, "deps"))
end
function SetupTestGeneratorProject(name, file)
project(name)
function SetupTestProject(name)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjects(name)
end
function SetupTestGeneratorProject(name)
project(name .. ".Gen")
kind "ConsoleApp"
language "C#"
location "."
debugdir(path.join(examplesdir, name))
files { file }
files { name .. ".cs" }
links
{
@ -22,28 +27,86 @@ function SetupTestGeneratorProject(name, file) @@ -22,28 +27,86 @@ function SetupTestGeneratorProject(name, file)
}
end
function SetupTestNativeProject(name, file)
project(name)
function SetupTestNativeProject(name)
project(name .. ".Native")
SetupNativeProject()
kind "SharedLib"
language "C++"
flags { common_flags }
files { "**.h", "**.cpp" }
end
function LinkNUnit()
libdirs
{
depsdir .. "/NUnit",
depsdir .. "/NSubstitute"
}
files { file }
links
{
"NUnit.Framework",
"NSubstitute"
}
end
function SetupTestProject(name, file, lib)
project(name)
function SetupTestProjects(name, file, lib)
project(name .. ".CSharp")
kind "ConsoleApp"
kind "SharedLib"
language "C#"
location "."
flags { "Unsafe" }
dependson { name .. ".Gen" }
files
{
path.join(gendir, name, name .. ".cs"),
}
project(name .. ".CLI")
kind "SharedLib"
language "C++"
flags { "Managed" }
dependson { name .. ".Gen" }
files
{
path.join(gendir, name, name .. ".cpp"),
path.join(gendir, name, name .. ".h"),
}
includedirs { path.join(testsdir, name), incdir }
links { name .. ".Native" }
project(name .. ".Tests.CSharp")
kind "SharedLib"
language "C#"
location "."
files { name .. ".Tests.cs" }
links { name .. ".CSharp" }
dependson { name .. ".Native" }
LinkNUnit()
project(name .. ".Tests.CLI")
kind "SharedLib"
language "C#"
location "."
files { file }
files { name .. ".Tests.cs" }
links { name .. ".CLI" }
dependson { name .. ".Native" }
links { lib }
LinkNUnit()
end
function IncludeExamples()

Loading…
Cancel
Save