Skip to content

Commit 3a50a54

Browse files
ddobrevtritao
authored andcommitted
Place all output of tests in their own directories
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 0b69eb8 commit 3a50a54

File tree

8 files changed

+14
-2
lines changed

8 files changed

+14
-2
lines changed

build/Tests.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function SetupTestNativeProject(name, depends)
6262

6363
kind "SharedLib"
6464
language "C++"
65+
targetdir (path.join(gendir, name))
6566

6667
files { "**.h", "**.cpp" }
6768
defines { "DLL_EXPORT" }
@@ -98,6 +99,7 @@ function SetupTestProjectsCLI(name, extraFiles, suffix)
9899
kind "SharedLib"
99100
language "C++"
100101
clr "NetCore"
102+
targetdir (path.join(gendir, name))
101103

102104
dependson { name .. ".Gen" }
103105

build/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ restore()
6262

6363
test()
6464
{
65-
dotnet test $bindir/${configuration}_$platform/*.Tests*.dll --nologo
65+
dotnet test {$bindir/${configuration}_$platform,$gendir/*}/*.Tests*.dll --nologo
6666
}
6767

6868
clean()

tests/NamespacesBase/NamespacesBase.CSharp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TestGeneratorName>NamespacesDerived.Gen</TestGeneratorName>
44
<TestGeneratorProjectDir>$(MSBuildProjectDirectory)\..\NamespacesDerived\</TestGeneratorProjectDir>
55
<EnableGeneratorCompileItems>false</EnableGeneratorCompileItems>
6+
<OutputPath>$(GenDir)NamespacesDerived</OutputPath>
67
</PropertyGroup>
78

89
<ItemGroup>

tests/NamespacesBase/premake4.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ end
88

99
group "Tests/Namespaces"
1010
SetupTestNativeProject("NamespacesBase")
11+
targetdir (path.join(gendir, "NamespacesDerived"))
1112
SetupWrapper("NamespacesBase")

tests/NamespacesDerived/NamespacesDerived.Gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override void Setup(Driver driver)
2525
module.IncludeDirs.Add(Path.GetFullPath(GetTestsDirectory(@base)));
2626
module.Headers.Add($"{@base}.h");
2727
module.OutputNamespace = @base;
28-
module.LibraryDirs.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
28+
module.LibraryDirs.Add(driver.Options.OutputDir);
2929
module.Libraries.Add($"{@base}.Native");
3030
driver.Options.Modules[1].Dependencies.Add(module);
3131
}

tests/Test.Bindings.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
44
<EnableGeneratorCompileItems>true</EnableGeneratorCompileItems>
5+
<OutputPath>$(GenDir)$(TestName)</OutputPath>
56
</PropertyGroup>
67

78
<ItemGroup>

tests/Test.Generator.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@
1818
<GeneratorInputs Include="*.h" />
1919
<CustomAdditionalCompileInputs Include="@(GeneratorInputs)" />
2020
<UpToDateCheckInput Include="@(GeneratorInputs)" />
21+
<ModuleFiles Include="$(OutputPath)*Std-symbols.*"
22+
Exclude="$(OutputPath)Std-symbols.pdb;$(OutputPath)Std-symbols.exp;$(OutputPath)Std-symbols.lib" />
2123
</ItemGroup>
24+
25+
<Target Name="CopyStdSymbols" AfterTargets="PostBuildEvent">
26+
<Copy SourceFiles="@(ModuleFiles)" DestinationFolder="$(GenDir)$(TestName)" />
27+
</Target>
2228
</Project>

tests/Test.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4+
<OutputPath>$(GenDir)$(TestName)</OutputPath>
45
</PropertyGroup>
56

67
<ItemGroup>

0 commit comments

Comments
 (0)