From 3a50a54fa4943aa8503550af497faae2048110ba Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 1 Dec 2020 20:02:16 +0200 Subject: [PATCH] Place all output of tests in their own directories Signed-off-by: Dimitar Dobrev --- build/Tests.lua | 2 ++ build/build.sh | 2 +- tests/NamespacesBase/NamespacesBase.CSharp.csproj | 1 + tests/NamespacesBase/premake4.lua | 1 + tests/NamespacesDerived/NamespacesDerived.Gen.cs | 2 +- tests/Test.Bindings.props | 1 + tests/Test.Generator.props | 6 ++++++ tests/Test.props | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build/Tests.lua b/build/Tests.lua index 148e64c9..62a3d734 100644 --- a/build/Tests.lua +++ b/build/Tests.lua @@ -62,6 +62,7 @@ function SetupTestNativeProject(name, depends) kind "SharedLib" language "C++" + targetdir (path.join(gendir, name)) files { "**.h", "**.cpp" } defines { "DLL_EXPORT" } @@ -98,6 +99,7 @@ function SetupTestProjectsCLI(name, extraFiles, suffix) kind "SharedLib" language "C++" clr "NetCore" + targetdir (path.join(gendir, name)) dependson { name .. ".Gen" } diff --git a/build/build.sh b/build/build.sh index bff366e8..e93bd176 100755 --- a/build/build.sh +++ b/build/build.sh @@ -62,7 +62,7 @@ restore() test() { - dotnet test $bindir/${configuration}_$platform/*.Tests*.dll --nologo + dotnet test {$bindir/${configuration}_$platform,$gendir/*}/*.Tests*.dll --nologo } clean() diff --git a/tests/NamespacesBase/NamespacesBase.CSharp.csproj b/tests/NamespacesBase/NamespacesBase.CSharp.csproj index 2a304a1d..4ca9764e 100644 --- a/tests/NamespacesBase/NamespacesBase.CSharp.csproj +++ b/tests/NamespacesBase/NamespacesBase.CSharp.csproj @@ -3,6 +3,7 @@ NamespacesDerived.Gen $(MSBuildProjectDirectory)\..\NamespacesDerived\ false + $(GenDir)NamespacesDerived diff --git a/tests/NamespacesBase/premake4.lua b/tests/NamespacesBase/premake4.lua index 0a1ec95a..51e1512f 100644 --- a/tests/NamespacesBase/premake4.lua +++ b/tests/NamespacesBase/premake4.lua @@ -8,4 +8,5 @@ end group "Tests/Namespaces" SetupTestNativeProject("NamespacesBase") + targetdir (path.join(gendir, "NamespacesDerived")) SetupWrapper("NamespacesBase") \ No newline at end of file diff --git a/tests/NamespacesDerived/NamespacesDerived.Gen.cs b/tests/NamespacesDerived/NamespacesDerived.Gen.cs index ab14cff8..cc017ff1 100644 --- a/tests/NamespacesDerived/NamespacesDerived.Gen.cs +++ b/tests/NamespacesDerived/NamespacesDerived.Gen.cs @@ -25,7 +25,7 @@ namespace CppSharp.Tests module.IncludeDirs.Add(Path.GetFullPath(GetTestsDirectory(@base))); module.Headers.Add($"{@base}.h"); module.OutputNamespace = @base; - module.LibraryDirs.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); + module.LibraryDirs.Add(driver.Options.OutputDir); module.Libraries.Add($"{@base}.Native"); driver.Options.Modules[1].Dependencies.Add(module); } diff --git a/tests/Test.Bindings.props b/tests/Test.Bindings.props index 2f4a3b1d..26f83cd1 100644 --- a/tests/Test.Bindings.props +++ b/tests/Test.Bindings.props @@ -2,6 +2,7 @@ true true + $(GenDir)$(TestName) diff --git a/tests/Test.Generator.props b/tests/Test.Generator.props index 8ea3c57d..7d808a08 100644 --- a/tests/Test.Generator.props +++ b/tests/Test.Generator.props @@ -18,5 +18,11 @@ + + + + + \ No newline at end of file diff --git a/tests/Test.props b/tests/Test.props index eceeb38c..ee6f5777 100644 --- a/tests/Test.props +++ b/tests/Test.props @@ -1,6 +1,7 @@ true + $(GenDir)$(TestName)