2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-18 13:32:49 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-09-19 11:04:37 +00:00
|
|
|
|
using System;
|
2017-09-18 13:32:49 +00: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 06:09:43 +00:00
|
|
|
|
using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false))
|
|
|
|
|
{
|
2017-10-22 07:18:39 +00:00
|
|
|
|
host.Storage.DeleteDirectory(string.Empty);
|
2017-09-18 13:32:49 +00:00
|
|
|
|
host.Run(new OsuTestCaseTestRunner(this));
|
2017-10-16 06:09:43 +00:00
|
|
|
|
}
|
2017-09-18 13:32:49 +00: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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|