Merge remote-tracking branch 'upstream/master' into cache-ruleset-dependencies-for-tests

This commit is contained in:
Salman Ahmed
2020-06-15 11:31:12 +03:00
815 changed files with 18208 additions and 6610 deletions

View File

@ -6,6 +6,8 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
@ -127,12 +129,21 @@ namespace osu.Game.Tests.Visual
}
}
localStorage = new Lazy<Storage>(() => new NativeStorage($"{GetType().Name}-{Guid.NewGuid()}"));
localStorage = new Lazy<Storage>(() => new NativeStorage(Path.Combine(RuntimeInfo.StartupDirectory, $"{GetType().Name}-{Guid.NewGuid()}")));
}
[Resolved]
protected AudioManager Audio { get; private set; }
/// <summary>
/// Creates the ruleset to be used for this test scene.
/// </summary>
/// <remarks>
/// When testing against ruleset-specific components, this method must be overriden to their corresponding ruleset.
/// </remarks>
[CanBeNull]
protected virtual Ruleset CreateRuleset() => null;
protected virtual IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TestBeatmap(ruleset);
protected WorkingBeatmap CreateWorkingBeatmap(RulesetInfo ruleset) =>
@ -144,7 +155,7 @@ namespace osu.Game.Tests.Visual
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
Ruleset.Value = rulesets.AvailableRulesets.First();
Ruleset.Value = CreateRuleset()?.RulesetInfo ?? rulesets.AvailableRulesets.First();
}
protected override void Dispose(bool isDisposing)
@ -190,7 +201,7 @@ namespace osu.Game.Tests.Visual
/// <param name="audio">Audio manager. Required if a reference clock isn't provided.</param>
/// <param name="length">The length of the returned virtual track.</param>
public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio, double length = 60000)
: base(beatmap, storyboard)
: base(beatmap, storyboard, audio)
{
if (referenceClock != null)
{