mirror of
https://github.com/ppy/osu
synced 2025-01-03 21:02:22 +00:00
Force OsuGameTests to use a unique storage each run
This commit is contained in:
parent
c179f9eb93
commit
f7c9c80566
@ -34,6 +34,8 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
protected TestOsuGame Game;
|
protected TestOsuGame Game;
|
||||||
|
|
||||||
|
protected override bool UseFreshStoragePerRun => true;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host)
|
private void load(GameHost host)
|
||||||
{
|
{
|
||||||
|
@ -118,6 +118,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
base.Content.Add(content = new DrawSizePreservingFillContainer());
|
base.Content.Add(content = new DrawSizePreservingFillContainer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual bool UseFreshStoragePerRun => false;
|
||||||
|
|
||||||
public virtual void RecycleLocalStorage()
|
public virtual void RecycleLocalStorage()
|
||||||
{
|
{
|
||||||
if (localStorage?.IsValueCreated == true)
|
if (localStorage?.IsValueCreated == true)
|
||||||
@ -133,7 +135,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
}
|
}
|
||||||
|
|
||||||
localStorage =
|
localStorage =
|
||||||
new Lazy<Storage>(() => host is HeadlessGameHost ? host.Storage : new NativeStorage(Path.Combine(RuntimeInfo.StartupDirectory, $"{GetType().Name}-{Guid.NewGuid()}")));
|
new Lazy<Storage>(() => !UseFreshStoragePerRun && host is HeadlessGameHost ? host.Storage : new NativeStorage(Path.Combine(RuntimeInfo.StartupDirectory, $"{GetType().Name}-{Guid.NewGuid()}")));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
|
Loading…
Reference in New Issue
Block a user