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
|
|
|
|
|
|
2017-09-19 19:04:37 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
2017-10-16 14:09:43 +08:00
|
|
|
|
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-10-16 14:09:43 +08:00
|
|
|
|
}
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|