Transition sequence before test is executed also between two test repetitions, ver. 2.198.1066
This commit is contained in:
@@ -774,52 +774,53 @@ namespace TBF.BenchControl.Sequences
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, timeEstTransBefore, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, timeEstTransAfter, 0 });
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
if (testMethod.DoTransitions())
|
||||
{
|
||||
rsltTransBefore = Transition(transitionBefore, TransitionContext.BeforeTest); /// Transition or SetRoute - start of test
|
||||
log.InfoFormat("Test {0}: Transition({1}, BeforeTest) returned {2}", test.Name, (transitionBefore == null ? "null" : transitionBefore.Name), rsltTransBefore);
|
||||
}
|
||||
|
||||
bool currentTestFinished = true;
|
||||
if (rsltTransBefore == Event.Done)
|
||||
bool doOneMoreRepetition = false;
|
||||
do
|
||||
{
|
||||
bool doOneMoreRepetition = false;
|
||||
do
|
||||
if (testMethod.DoTransitions())
|
||||
{
|
||||
log.InfoFormat("Test {0}: Execute(., {1}, {2})", test.Name, repetNr, isOuterLoopMode || repetNr == test.Repeats);
|
||||
e = testMethod.Execute(test, repetNr, isOuterLoopMode || repetNr == test.Repeats);
|
||||
|
||||
if (e.Contains(Event.MakeSecondPass) && testMethod is ITestMethodWith2ndPass)
|
||||
{
|
||||
deferredData.Add(new DeferredTestEvaluationData(test, repetNr, (testMethod as ITestMethodWith2ndPass).IntermediateData));
|
||||
}
|
||||
|
||||
currentTestFinished = (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, currentTestFinished ? Config.Entities.Progress.Completed
|
||||
: Config.Entities.Progress.Aborted));
|
||||
|
||||
if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop
|
||||
if (currentTestFinished && !isOuterLoopMode) repetNr++;
|
||||
|
||||
doOneMoreRepetition = currentTestFinished && !isOuterLoopMode && (repetNr <= test.Repeats);
|
||||
|
||||
if (testMethod.DoTransitions() && doOneMoreRepetition)
|
||||
{
|
||||
rsltTransBetween = Transition(transitionBetween, TransitionContext.BeforeTest); /// Transition or SetRoute - start of test
|
||||
log.InfoFormat("Test {0}: Transition({1}, BetweenTests) returned {2}", test.Name, (transitionBetween == null ? "null" : transitionBetween.Name), rsltTransBetween);
|
||||
}
|
||||
/// Make a transition before a test and before each test repetition
|
||||
rsltTransBefore = Transition(transitionBefore, TransitionContext.BeforeTest); /// Transition or SetRoute - start of test
|
||||
log.InfoFormat("Test {0}: Transition({1}, BeforeTest) returned {2}", test.Name, (transitionBefore == null ? "null" : transitionBefore.Name), rsltTransBefore);
|
||||
}
|
||||
while ((rsltTransBetween == Event.Done) && doOneMoreRepetition);
|
||||
if (rsltTransBefore != Event.Done) break;
|
||||
|
||||
if (currentTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr
|
||||
log.InfoFormat("Test {0}: Execute(., {1}, {2})", test.Name, repetNr, isOuterLoopMode || repetNr == test.Repeats);
|
||||
e = testMethod.Execute(test, repetNr, isOuterLoopMode || repetNr == test.Repeats);
|
||||
|
||||
if (e.Contains(Event.MakeSecondPass) && testMethod is ITestMethodWith2ndPass)
|
||||
{
|
||||
deferredData.Add(new DeferredTestEvaluationData(test, repetNr, (testMethod as ITestMethodWith2ndPass).IntermediateData));
|
||||
}
|
||||
|
||||
currentTestFinished = (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, currentTestFinished ? Config.Entities.Progress.Completed
|
||||
: Config.Entities.Progress.Aborted));
|
||||
|
||||
if (e.Contains(Event.OuterLoopStart)) break; /// Do not repeat OuterLoopStart test in this loop
|
||||
if (currentTestFinished && !isOuterLoopMode) repetNr++;
|
||||
|
||||
doOneMoreRepetition = currentTestFinished && !isOuterLoopMode && (repetNr <= test.Repeats);
|
||||
|
||||
if (testMethod.DoTransitions() && doOneMoreRepetition)
|
||||
{
|
||||
/// Make a transition between two test repetitions
|
||||
rsltTransBetween = Transition(transitionBetween, TransitionContext.BetweenTests); /// Transition or SetRoute - start of test
|
||||
log.InfoFormat("Test {0}: Transition({1}, BetweenTests) returned {2}", test.Name, (transitionBetween == null ? "null" : transitionBetween.Name), rsltTransBetween);
|
||||
}
|
||||
}
|
||||
while ((rsltTransBetween == Event.Done) && doOneMoreRepetition);
|
||||
|
||||
if (currentTestFinished && !isOuterLoopMode && repetNr > test.Repeats) repetNr = 1; /// Reset repetNr
|
||||
|
||||
if (testMethod.DoTransitions())
|
||||
{
|
||||
/// Make a transition after the last test repetition
|
||||
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);
|
||||
|
||||
@@ -430,6 +430,7 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
PurgeBegin,
|
||||
BeforeTest,
|
||||
BetweenTests,
|
||||
AfterTest,
|
||||
PurgeEnd,
|
||||
Stop,
|
||||
@@ -468,12 +469,13 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
switch (context)
|
||||
{
|
||||
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
|
||||
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
|
||||
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
|
||||
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
||||
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
||||
default: message = "Transition"; break;
|
||||
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
|
||||
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
|
||||
case TransitionContext.BetweenTests: message = Strings.Between_tests_sequence_i_n; break;
|
||||
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
|
||||
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
||||
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
||||
default: message = "Transition"; break;
|
||||
}
|
||||
|
||||
if (transitionSequence == null)
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1065.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1065.0")]
|
||||
[assembly: AssemblyVersion("2.18.1066.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1066.0")]
|
||||
|
||||
Generated
+9
@@ -519,6 +519,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Between tests ({0}: step {1}/{2}).
|
||||
/// </summary>
|
||||
internal static string Between_tests_sequence_i_n {
|
||||
get {
|
||||
return ResourceManager.GetString("Between_tests_sequence_i_n", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Build date {0}.
|
||||
/// </summary>
|
||||
|
||||
@@ -1885,4 +1885,7 @@
|
||||
<data name="_0_wait_until_tank_contains_more_then_1_l" xml:space="preserve">
|
||||
<value>{0} - wait until the tank contains more then {1} ltr.</value>
|
||||
</data>
|
||||
<data name="Between_tests_sequence_i_n" xml:space="preserve">
|
||||
<value>Between tests ({0}: step {1}/{2})</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user