Browse Source

Cleaned up test build scripts.

pull/45/merge
triton 12 years ago
parent
commit
cdc57d5c0a
  1. 53
      build/Tests.lua

53
build/Tests.lua

@ -5,10 +5,17 @@ function SetupExampleProject() @@ -5,10 +5,17 @@ function SetupExampleProject()
location (path.join(builddir, "deps"))
end
function SetupTestProject(name)
function SetupTestProject(name, file, lib)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjects(name)
SetupTestProjectsCSharp(name, file, lib)
SetupTestProjectsCLI(name, file, lib)
end
function SetupTestCSharp(name)
SetupTestGeneratorProject(name)
SetupTestNativeProject(name)
SetupTestProjectsCSharp(name)
end
function SetupTestGeneratorProject(name)
@ -30,6 +37,11 @@ function SetupTestGeneratorProject(name) @@ -30,6 +37,11 @@ function SetupTestGeneratorProject(name)
}
end
function SetupTestGeneratorBuildEvent(name)
local exePath = SafePath("$(TargetDir)" .. name .. ".Gen.exe")
prebuildcommands { exePath }
end
function SetupTestNativeProject(name)
project(name .. ".Native")
@ -55,12 +67,7 @@ function LinkNUnit() @@ -55,12 +67,7 @@ function LinkNUnit()
}
end
function SetupTestGen(name)
local exePath = SafePath("$(TargetDir)" .. name .. ".Gen.exe")
prebuildcommands { exePath }
end
function SetupTestProjects(name, file, lib)
function SetupTestProjectsCSharp(name, file, lib)
project(name .. ".CSharp")
kind "SharedLib"
@ -69,7 +76,7 @@ function SetupTestProjects(name, file, lib) @@ -69,7 +76,7 @@ function SetupTestProjects(name, file, lib)
flags { "Unsafe" }
dependson { name .. ".Gen", name .. ".Native" }
SetupTestGen(name)
SetupTestGeneratorBuildEvent(name)
files
{
@ -78,6 +85,20 @@ function SetupTestProjects(name, file, lib) @@ -78,6 +85,20 @@ function SetupTestProjects(name, file, lib)
links { "CppSharp.Runtime" }
project(name .. ".Tests.CSharp")
kind "SharedLib"
language "C#"
location "."
files { name .. ".Tests.cs" }
links { name .. ".CSharp" }
dependson { name .. ".Native" }
LinkNUnit()
end
function SetupTestProjectsCLI(name, file, lib)
project(name .. ".CLI")
SetupNativeProject()
@ -86,7 +107,7 @@ function SetupTestProjects(name, file, lib) @@ -86,7 +107,7 @@ function SetupTestProjects(name, file, lib)
flags { "Managed" }
dependson { name .. ".Gen", name .. ".Native" }
SetupTestGen(name)
SetupTestGeneratorBuildEvent(name)
files
{
@ -97,18 +118,6 @@ function SetupTestProjects(name, file, lib) @@ -97,18 +118,6 @@ function SetupTestProjects(name, file, lib)
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"

Loading…
Cancel
Save