// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Runtime.CompilerServices; using osu.Framework.Platform; namespace osu.Game.Tests { /// /// A headless host which cleans up before running (removing any remnants from a previous execution). /// public class CleanRunHeadlessGameHost : HeadlessGameHost { /// /// Create a new instance. /// /// An optional suffix which will isolate this host from others called from the same method source. /// Whether to bind IPC channels. /// Whether the host should be forced to run in realtime, rather than accelerated test time. /// The name of the calling method, used for test file isolation and clean-up. public CleanRunHeadlessGameHost(string gameSuffix = @"", bool bindIPC = false, bool realtime = true, [CallerMemberName] string callingMethodName = @"") : base(callingMethodName + gameSuffix, bindIPC, realtime) { } protected override void SetupForRun() { base.SetupForRun(); Storage.DeleteDirectory(string.Empty); } } }