Browse Source

Place all output of tests in their own directories

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1548/head
Dimitar Dobrev 5 years ago committed by João Matos
parent
commit
3a50a54fa4
  1. 2
      build/Tests.lua
  2. 2
      build/build.sh
  3. 1
      tests/NamespacesBase/NamespacesBase.CSharp.csproj
  4. 1
      tests/NamespacesBase/premake4.lua
  5. 2
      tests/NamespacesDerived/NamespacesDerived.Gen.cs
  6. 1
      tests/Test.Bindings.props
  7. 6
      tests/Test.Generator.props
  8. 1
      tests/Test.props

2
build/Tests.lua

@ -62,6 +62,7 @@ function SetupTestNativeProject(name, depends) @@ -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) @@ -98,6 +99,7 @@ function SetupTestProjectsCLI(name, extraFiles, suffix)
kind "SharedLib"
language "C++"
clr "NetCore"
targetdir (path.join(gendir, name))
dependson { name .. ".Gen" }

2
build/build.sh

@ -62,7 +62,7 @@ restore() @@ -62,7 +62,7 @@ restore()
test()
{
dotnet test $bindir/${configuration}_$platform/*.Tests*.dll --nologo
dotnet test {$bindir/${configuration}_$platform,$gendir/*}/*.Tests*.dll --nologo
}
clean()

1
tests/NamespacesBase/NamespacesBase.CSharp.csproj

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
<TestGeneratorName>NamespacesDerived.Gen</TestGeneratorName>
<TestGeneratorProjectDir>$(MSBuildProjectDirectory)\..\NamespacesDerived\</TestGeneratorProjectDir>
<EnableGeneratorCompileItems>false</EnableGeneratorCompileItems>
<OutputPath>$(GenDir)NamespacesDerived</OutputPath>
</PropertyGroup>
<ItemGroup>

1
tests/NamespacesBase/premake4.lua

@ -8,4 +8,5 @@ end @@ -8,4 +8,5 @@ end
group "Tests/Namespaces"
SetupTestNativeProject("NamespacesBase")
targetdir (path.join(gendir, "NamespacesDerived"))
SetupWrapper("NamespacesBase")

2
tests/NamespacesDerived/NamespacesDerived.Gen.cs

@ -25,7 +25,7 @@ namespace CppSharp.Tests @@ -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);
}

1
tests/Test.Bindings.props

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableGeneratorCompileItems>true</EnableGeneratorCompileItems>
<OutputPath>$(GenDir)$(TestName)</OutputPath>
</PropertyGroup>
<ItemGroup>

6
tests/Test.Generator.props

@ -18,5 +18,11 @@ @@ -18,5 +18,11 @@
<GeneratorInputs Include="*.h" />
<CustomAdditionalCompileInputs Include="@(GeneratorInputs)" />
<UpToDateCheckInput Include="@(GeneratorInputs)" />
<ModuleFiles Include="$(OutputPath)*Std-symbols.*"
Exclude="$(OutputPath)Std-symbols.pdb;$(OutputPath)Std-symbols.exp;$(OutputPath)Std-symbols.lib" />
</ItemGroup>
<Target Name="CopyStdSymbols" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(ModuleFiles)" DestinationFolder="$(GenDir)$(TestName)" />
</Target>
</Project>

1
tests/Test.props

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputPath>$(GenDir)$(TestName)</OutputPath>
</PropertyGroup>
<ItemGroup>

Loading…
Cancel
Save