1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fix ImportCollectionsTest.TestSaveAndReload not cleaning up before/after run

This commit is contained in:
Dean Herbert 2021-12-22 13:38:20 +09:00
parent a88800c99a
commit f81e32149b
2 changed files with 5 additions and 4 deletions

View File

@ -128,7 +128,7 @@ namespace osu.Game.Tests.Collections.IO
[Test] [Test]
public async Task TestSaveAndReload() public async Task TestSaveAndReload()
{ {
using (HeadlessGameHost host = new TestRunHeadlessGameHost("TestSaveAndReload", bypassCleanup: true)) using (HeadlessGameHost host = new CleanRunHeadlessGameHost(bypassCleanup: true))
{ {
try try
{ {
@ -149,7 +149,7 @@ namespace osu.Game.Tests.Collections.IO
} }
} }
using (HeadlessGameHost host = new TestRunHeadlessGameHost("TestSaveAndReload")) using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestSaveAndReload)))
{ {
try try
{ {

View File

@ -17,9 +17,10 @@ namespace osu.Game.Tests
/// <param name="gameSuffix">An optional suffix which will isolate this host from others called from the same method source.</param> /// <param name="gameSuffix">An optional suffix which will isolate this host from others called from the same method source.</param>
/// <param name="bindIPC">Whether to bind IPC channels.</param> /// <param name="bindIPC">Whether to bind IPC channels.</param>
/// <param name="realtime">Whether the host should be forced to run in realtime, rather than accelerated test time.</param> /// <param name="realtime">Whether the host should be forced to run in realtime, rather than accelerated test time.</param>
/// <param name="bypassCleanup">Whether to bypass directory cleanup on host disposal. Should be used only if a subsequent test relies on the files still existing.</param>
/// <param name="callingMethodName">The name of the calling method, used for test file isolation and clean-up.</param> /// <param name="callingMethodName">The name of the calling method, used for test file isolation and clean-up.</param>
public CleanRunHeadlessGameHost(string gameSuffix = @"", bool bindIPC = false, bool realtime = true, [CallerMemberName] string callingMethodName = @"") public CleanRunHeadlessGameHost(string gameSuffix = @"", bool bindIPC = false, bool realtime = true, bool bypassCleanup = false, [CallerMemberName] string callingMethodName = @"")
: base(callingMethodName + gameSuffix, bindIPC, realtime) : base(callingMethodName + gameSuffix, bindIPC, realtime, bypassCleanup: bypassCleanup)
{ {
} }