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

2
build/build.sh

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

1
tests/NamespacesBase/NamespacesBase.CSharp.csproj

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

1
tests/NamespacesBase/premake4.lua

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

2
tests/NamespacesDerived/NamespacesDerived.Gen.cs

@ -25,7 +25,7 @@ namespace CppSharp.Tests
module.IncludeDirs.Add(Path.GetFullPath(GetTestsDirectory(@base))); module.IncludeDirs.Add(Path.GetFullPath(GetTestsDirectory(@base)));
module.Headers.Add($"{@base}.h"); module.Headers.Add($"{@base}.h");
module.OutputNamespace = @base; module.OutputNamespace = @base;
module.LibraryDirs.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); module.LibraryDirs.Add(driver.Options.OutputDir);
module.Libraries.Add($"{@base}.Native"); module.Libraries.Add($"{@base}.Native");
driver.Options.Modules[1].Dependencies.Add(module); driver.Options.Modules[1].Dependencies.Add(module);
} }

1
tests/Test.Bindings.props

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

6
tests/Test.Generator.props

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

1
tests/Test.props

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

Loading…
Cancel
Save