Browse Source

Cleaned up test build scripts.

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

55
build/Tests.lua

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

Loading…
Cancel
Save