diff --git a/osu.Framework/Testing/TestBrowser.cs b/osu.Framework/Testing/TestBrowser.cs index 7ccfca25c6..8f5b708471 100644 --- a/osu.Framework/Testing/TestBrowser.cs +++ b/osu.Framework/Testing/TestBrowser.cs @@ -590,7 +590,7 @@ private static IEnumerable getTestCaseSourceValue(MethodInfo testMethod, TestCas private void runTests(Action onCompletion) { int actualStepCount = 0; - CurrentTest.RunAllSteps(onCompletion, e => Logger.Log($@"Error on step: {e}"), s => + CurrentTest.RunAllSteps(onCompletion, (s, e) => Logger.Error(e, $"Step {s} triggered an error"), s => { if (!interactive || RunAllSteps.Value) return false; diff --git a/osu.Framework/Testing/TestScene.cs b/osu.Framework/Testing/TestScene.cs index 4cc97bf25f..545f59161e 100644 --- a/osu.Framework/Testing/TestScene.cs +++ b/osu.Framework/Testing/TestScene.cs @@ -204,7 +204,7 @@ protected TestScene() private ScheduledDelegate stepRunner; private readonly ScrollContainer scroll; - public void RunAllSteps(Action onCompletion = null, Action onError = null, Func stopCondition = null, StepButton startFromStep = null) + public void RunAllSteps(Action onCompletion = null, Action onError = null, Func stopCondition = null, StepButton startFromStep = null) { // schedule once as we want to ensure we have run our LoadComplete before attempting to execute steps. // a user may be adding a step in LoadComplete. @@ -222,7 +222,7 @@ public void RunAllSteps(Action onCompletion = null, Action onError = private StepButton loadableStep => actionIndex >= 0 ? StepsContainer.Children.ElementAtOrDefault(actionIndex) as StepButton : null; - private void runNextStep(Action onCompletion, Action onError, Func stopCondition) + private void runNextStep(Action onCompletion, Action onError, Func stopCondition) { try { @@ -242,7 +242,7 @@ private void runNextStep(Action onCompletion, Action onError, Func s is LabelStep); + RunAllSteps(startFromStep: step, stopCondition: s => s is LabelStep, onError: (s, e) => Logger.Error(e, $"Step {s} triggered error")); }, }); } diff --git a/osu.Framework/Testing/TestSceneTestRunner.cs b/osu.Framework/Testing/TestSceneTestRunner.cs index f4e6bf53fc..32f05b7076 100644 --- a/osu.Framework/Testing/TestSceneTestRunner.cs +++ b/osu.Framework/Testing/TestSceneTestRunner.cs @@ -76,7 +76,7 @@ void complete() test.RunAllSteps(() => { Scheduler.AddDelayed(complete, time_between_tests); - }, e => + }, (_, e) => { exception = ExceptionDispatchInfo.Capture(e); complete();