From 385825c9e8ce07fbd63edf37a8898c3570c3f1f4 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 1 Jun 2018 13:58:59 +0200 Subject: [PATCH] Progress bar bug fix for repeated tests. --- TBF/BenchControl/Sequences/MainSeq.cs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/TBF/BenchControl/Sequences/MainSeq.cs b/TBF/BenchControl/Sequences/MainSeq.cs index 86a1053f5..14d3b8b94 100644 --- a/TBF/BenchControl/Sequences/MainSeq.cs +++ b/TBF/BenchControl/Sequences/MainSeq.cs @@ -705,7 +705,7 @@ namespace TBF.BenchControl.Sequences log.InfoFormat("Test {0}: Transition({1}, BeforeTest) returned {2}", test.Name, (transitionBefore == null ? "null" : transitionBefore.Name), rsltTransBefore); } - bool lastTestFinished = true; + bool currentTestFinished = true; if (rsltTransBefore == Event.Done) { do @@ -718,28 +718,28 @@ namespace TBF.BenchControl.Sequences deferredData.Add(new DeferredTestEvaluationData(test, repetNr, (testMethod as ITestMethodWith2ndPass).IntermediateData)); } - lastTestFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error) + currentTestFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error) && !e.Contains(Event.ConfigurationError) && !e.Contains(Event.OpArgumentError) && !e.Contains(Event.UiCmdStop)); - if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop - if (lastTestFinished && !isOuterLoopMode) repetNr++; - } - while (lastTestFinished && !isOuterLoopMode && repetNr <= test.Repeats); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, currentTestFinished ? Config.Entities.Progress.Completed + : Config.Entities.Progress.Aborted)); - if (lastTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr + if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop + if (currentTestFinished && !isOuterLoopMode) repetNr++; + } + while (currentTestFinished && !isOuterLoopMode && repetNr <= test.Repeats); + + if (currentTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr } if (testMethod.DoTransitions()) { - TransitionContext endContext = lastTestFinished ? TransitionContext.AfterTest : TransitionContext.Stop; + TransitionContext endContext = currentTestFinished ? TransitionContext.AfterTest : TransitionContext.Stop; rsltTransAfter = Transition(transitionAfter, endContext); /// Transition or SetRoute - end of test log.InfoFormat("Test {0}: Transition({1}, {2}) returned {3}", test.Name, (transitionAfter == null ? "null" : transitionAfter.Name), endContext, rsltTransAfter); } - - Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, lastTestFinished ? Config.Entities.Progress.Completed - : Config.Entities.Progress.Aborted)); } if (rsltTransBefore == Event.Error || e.Contains(Event.Error)) @@ -911,6 +911,9 @@ namespace TBF.BenchControl.Sequences bool testFinished = (rsltTransBefore == Event.Done && !e.Contains(Event.Error) && !e.Contains(Event.ConfigurationError) && !e.Contains(Event.OpArgumentError) && !e.Contains(Event.UiCmdStop)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, testFinished ? Config.Entities.Progress.Completed + : Config.Entities.Progress.Aborted)); + if (testMethod.DoTransitions()) { TransitionContext endContext = testFinished ? TransitionContext.AfterTest : TransitionContext.Stop;