mirror of
https://github.com/ppy/osu
synced 2024-12-29 10:22:43 +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 override bool UseFreshStoragePerRun => true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(GameHost host)
|
||||
{
|
||||
|
@ -118,6 +118,8 @@ namespace osu.Game.Tests.Visual
|
||||
base.Content.Add(content = new DrawSizePreservingFillContainer());
|
||||
}
|
||||
|
||||
protected virtual bool UseFreshStoragePerRun => false;
|
||||
|
||||
public virtual void RecycleLocalStorage()
|
||||
{
|
||||
if (localStorage?.IsValueCreated == true)
|
||||
@ -133,7 +135,7 @@ namespace osu.Game.Tests.Visual
|
||||
}
|
||||
|
||||
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]
|
||||
|
Loading…
Reference in New Issue
Block a user