mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 12:32:54 +08:00
Allow testing
This commit is contained in:
parent
4a5a453c7f
commit
91ca245c58
39
build.cake
39
build.cake
@ -1,22 +1,14 @@
|
|||||||
#tool Microsoft.TestPlatform.Portable
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// ARGUMENTS
|
// ARGUMENTS
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
var target = Argument("target", "Test");
|
var target = Argument("target", "Build");
|
||||||
var framework = Argument("framework", "net471");
|
var framework = Argument("framework", "net471");
|
||||||
var configuration = Argument("configuration", "Debug");
|
var configuration = Argument("configuration", "Release");
|
||||||
|
|
||||||
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
|
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
|
||||||
|
|
||||||
var testProjects = new [] {
|
var testProjects = GetFiles("**/*.Tests.csproj");
|
||||||
new FilePath("./osu.Game.Tests/osu.Game.Tests.csproj"),
|
|
||||||
new FilePath("./osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj"),
|
|
||||||
new FilePath("./osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj"),
|
|
||||||
new FilePath("./osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj"),
|
|
||||||
new FilePath("./osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj"),
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// TASKS
|
// TASKS
|
||||||
@ -26,22 +18,23 @@ Task("Compile")
|
|||||||
.Does(() => {
|
.Does(() => {
|
||||||
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
|
DotNetCoreBuild(osuDesktop.FullPath, new DotNetCoreBuildSettings {
|
||||||
Framework = framework,
|
Framework = framework,
|
||||||
Configuration = "Debug"
|
Configuration = configuration
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("CompileTests")
|
|
||||||
.DoesForEach(testProjects, testProject => {
|
|
||||||
DotNetCoreBuild(testProject.FullPath, new DotNetCoreBuildSettings {
|
|
||||||
Framework = framework
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
Task("Test")
|
Task("Test")
|
||||||
.IsDependentOn("CompileTests")
|
.ContinueOnError()
|
||||||
.Does(() => {
|
.DoesForEach(testProjects, testProject => {
|
||||||
VSTest($"./*.Tests/bin/{configuration}/{framework}/**/*Tests.exe");
|
DotNetCoreTest(testProject.FullPath, new DotNetCoreTestSettings {3
|
||||||
|
Framework = framework,
|
||||||
|
Configuration = configuration,
|
||||||
|
Logger = $"trx;LogFileName={testProject.GetFilename()}.trx",
|
||||||
|
ResultsDirectory = "./TestResults/"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Task("Build")
|
||||||
|
.IsDependentOn("Compile")
|
||||||
|
.IsDependentOn("Test");
|
||||||
|
|
||||||
RunTarget(target);
|
RunTarget(target);
|
Loading…
Reference in New Issue
Block a user