diff --git a/build/Tests.lua b/build/Tests.lua index e75e7957..e0b87855 100644 --- a/build/Tests.lua +++ b/build/Tests.lua @@ -5,10 +5,17 @@ function SetupExampleProject() location (path.join(builddir, "deps")) 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) SetupTestNativeProject(name) - SetupTestProjects(name) + SetupTestProjectsCSharp(name) end 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() } 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) flags { "Unsafe" } dependson { name .. ".Gen", name .. ".Native" } - SetupTestGen(name) + SetupTestGeneratorBuildEvent(name) files { @@ -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) flags { "Managed" } dependson { name .. ".Gen", name .. ".Native" } - SetupTestGen(name) + SetupTestGeneratorBuildEvent(name) files { @@ -95,19 +116,7 @@ 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() + links { name .. ".Native" } project(name .. ".Tests.CLI")