1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 03:52:57 +08:00
osu-lazer/osu.Game/Tests/Visual/OsuTestCase.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2017-09-18 21:32:49 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
2017-09-18 21:32:49 +08:00
using osu.Framework.Platform;
using osu.Framework.Testing;
namespace osu.Game.Tests.Visual
{
public abstract class OsuTestCase : TestCase
{
public override void RunTest()
{
using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false))
{
2017-10-22 15:18:39 +08:00
host.Storage.DeleteDirectory(string.Empty);
2017-09-18 21:32:49 +08:00
host.Run(new OsuTestCaseTestRunner(this));
}
2017-09-18 21:32:49 +08:00
}
public class OsuTestCaseTestRunner : OsuGameBase
{
private readonly OsuTestCase testCase;
public OsuTestCaseTestRunner(OsuTestCase testCase)
{
this.testCase = testCase;
}
protected override void LoadComplete()
{
base.LoadComplete();
Add(new TestCaseTestRunner.TestRunner(testCase));
}
}
}
}