Skip to content

Commit

Permalink
Merge branch 'Bertec-feature/speed-up'
Browse files Browse the repository at this point in the history
  • Loading branch information
sagatowski committed Dec 8, 2019
2 parents ff33d4c + 9836717 commit e4dfebd
Show file tree
Hide file tree
Showing 22 changed files with 153 additions and 145 deletions.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,28 @@ This is an example of how it can look running the TcUnit-Verifier_DotNet:

```
C:\Code\TcUnit\TcUnit-Verifier\TcUnit-Verifier_DotNet\TcUnit-Verifier\bin\Debug>TcUnit-Verifier.exe -v "C:\Code\TcUnit\TcUnit-Verifier\TcUnit-Verifier_TwinCAT\TcUnit-Verifier_TwinCAT.sln"
2019-07-31 14:35:05 - Starting TcUnit-Verifier...
2019-07-31 14:35:05 - Loading the Visual Studio Development Tools Environment (DTE)...
2019-07-31 14:35:38 - Cleaning and building TcUnit-Verifier_TwinCAT solution...
2019-07-31 14:35:39 - Generating TcUnit-Verifier_TwinCAT boot project...
2019-07-31 14:35:59 - Activating TcUnit-Verifier_TwinCAT configuration...
2019-07-31 14:35:59 - Restaring TwinCAT...
2019-07-31 14:35:59 - Waiting for TcUnit-Verifier_TwinCAT to finish running tests...
2019-07-31 14:36:12 - Asserting results...
2019-07-31 14:36:31 - Done.
2019-07-31 14:36:31 - Closing the Visual Studio Development Tools Environment (DTE), please wait...
2019-07-31 14:36:51 - Exiting application...
2019-12-05 16:23:23 - Starting TcUnit-Verifier...
2019-12-05 16:23:23 - Loading the Visual Studio Development Tools Environment (DTE)...
2019-12-05 16:23:49 - Cleaning and building TcUnit-Verifier_TwinCAT solution...
2019-12-05 16:23:49 - Generating TcUnit-Verifier_TwinCAT boot project...
2019-12-05 16:24:03 - Activating TcUnit-Verifier_TwinCAT configuration...
2019-12-05 16:24:07 - Restarting TwinCAT...
2019-12-05 16:24:07 - Waiting for TcUnit-Verifier_TwinCAT to finish running tests...
2019-12-05 16:24:08 - ... got 5 report lines so far.
2019-12-05 16:24:10 - ... got 5 report lines so far.
2019-12-05 16:24:11 - ... got 26 report lines so far.
2019-12-05 16:24:12 - ... got 51 report lines so far.
2019-12-05 16:24:14 - ... got 76 report lines so far.
2019-12-05 16:24:15 - ... got 93 report lines so far.
2019-12-05 16:24:16 - ... got 118 report lines so far.
2019-12-05 16:24:17 - ... got 134 report lines so far.
2019-12-05 16:24:18 - ... got 151 report lines so far.
2019-12-05 16:24:20 - ... got 176 report lines so far.
2019-12-05 16:24:21 - ... got 184 report lines so far.
2019-12-05 16:24:21 - Asserting results...
2019-12-05 16:24:21 - Done.
2019-12-05 16:24:21 - Closing the Visual Studio Development Tools Environment (DTE), please wait...
2019-12-05 16:24:24 - Exiting application...
```
If there was an error in the TcUnit framework this would be shown between the
lines `Asserting results...` and `Done.`. If nothing is shown between these
Expand Down
45 changes: 45 additions & 0 deletions TcUnit-Verifier_DotNet/TcUnit-Verifier/ErrorList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using EnvDTE80;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace TcUnit.Verifier
{
class ErrorList : IEnumerable<ErrorList.Error>, IEnumerable
{
protected List<Error> _errors = new List<Error>();

public struct Error
{
public string Description;
public vsBuildErrorLevel ErrorLevel;

public Error(ErrorItem item)
{
Description = item.Description.ToUpper();
ErrorLevel = item.ErrorLevel;
}
}

public IEnumerable<Error> AddNew(ErrorItems errorItems)
{
int N1 = _errors.Count + 1;
int N2 = errorItems.Count;
for (int i = N1; i <= N2; i++)
{
var item = errorItems.Item(i);
_errors.Add(new Error(item));
}
return _errors.GetRange(N1 - 1, N2 + 1 - N1);
}

IEnumerator<Error> IEnumerable<Error>.GetEnumerator() {
return _errors.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator()
{
return _errors.GetEnumerator();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_AdjustAssertFailureMessageToMax252CharLengthTest : TestFunctionBlockAssert
{
public FB_AdjustAssertFailureMessageToMax252CharLengthTest(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AdjustAssertFailureMessageToMax252CharLengthTest(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
TestInstancePath252CharsExpectTooLongTestInstancePath();
TestInstancePath220CharsExpectShortenedTestInstancePath();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_AnyPrimitiveTypes : TestFunctionBlockAssert
{
public FB_AnyPrimitiveTypes(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AnyPrimitiveTypes(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
Test_ANY_BYTE_Equals();
Test_ANY_BYTE_Differ();
Expand Down
5 changes: 2 additions & 3 deletions TcUnit-Verifier_DotNet/TcUnit-Verifier/FB_AnyToUnionValue.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_AnyToUnionValue : TestFunctionBlockAssert
{
public FB_AnyToUnionValue(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AnyToUnionValue(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
Test_BOOL();
Test_BIT();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_ArrayPrimitiveTypes : TestFunctionBlockAssert
{
public FB_ArrayPrimitiveTypes(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_ArrayPrimitiveTypes(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
Test_BOOL_Array_Equals();
Test_BOOL_Array_DifferInSize();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_AssertEveryFailedTestTwice : TestFunctionBlockAssert
{
public FB_AssertEveryFailedTestTwice(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AssertEveryFailedTestTwice(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
TwiceAssertCall();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_AssertEveryFailedTestTwiceArrayVersion : TestFunctionBlockAssert
{
public FB_AssertEveryFailedTestTwiceArrayVersion(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AssertEveryFailedTestTwiceArrayVersion(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
TwiceAssertCall_Arrays();
}
Expand Down
5 changes: 2 additions & 3 deletions TcUnit-Verifier_DotNet/TcUnit-Verifier/FB_AssertTrueFalse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_AssertTrueFalse : TestFunctionBlockAssert
{
public FB_AssertTrueFalse(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_AssertTrueFalse(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
AssertThatINTsAreEqual();
AssertThatINTsAreNotEqual();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_CheckIfSpecificTestIsFinished : TestFunctionBlockAssert
{
public FB_CheckIfSpecificTestIsFinished(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_CheckIfSpecificTestIsFinished(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
TestThatInstantlyFinishes();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_CreateDisabledTest : TestFunctionBlockAssert
{
public FB_CreateDisabledTest(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_CreateDisabledTest(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
TestEnabled();
TestDisabled();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_CreateFourTestsWithSameName : TestFunctionBlockAssert
{
public FB_CreateFourTestsWithSameName(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_CreateFourTestsWithSameName(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
TestOne();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_MultipleAssertWithSameParametersInDifferentCyclesAndInSameTest : TestFunctionBlockAssert
{
public FB_MultipleAssertWithSameParametersInDifferentCyclesAndInSameTest(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_MultipleAssertWithSameParametersInDifferentCyclesAndInSameTest(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
Assert_SeveralTimes();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_MultipleAssertWithSameParametersInDifferentCyclesButWithDifferentTests : TestFunctionBlockAssert
{
public FB_MultipleAssertWithSameParametersInDifferentCyclesButWithDifferentTests(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_MultipleAssertWithSameParametersInDifferentCyclesButWithDifferentTests(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
Assert_SeveralTimes();
Assert_SeveralTimesAgain();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,8 @@ namespace TcUnit.Verifier
{
class FB_MultipleAssertWithSameParametersInSameCycleWithSameTest : TestFunctionBlockAssert
{
public FB_MultipleAssertWithSameParametersInSameCycleWithSameTest(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_MultipleAssertWithSameParametersInSameCycleWithSameTest(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
Assert_SeveralTimes();
}
Expand Down
5 changes: 2 additions & 3 deletions TcUnit-Verifier_DotNet/TcUnit-Verifier/FB_PrimitiveTypes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,7 +8,7 @@ namespace TcUnit.Verifier
{
class FB_PrimitiveTypes : TestFunctionBlockAssert
{
public FB_PrimitiveTypes(ErrorItems errorItems, string testFunctionBlockInstance = null) : base(errorItems, testFunctionBlockInstance)
public FB_PrimitiveTypes(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null) : base(errors, testFunctionBlockInstance)
{
Test_ANY_Equals();
Test_ANY_Differ_DataType();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,8 +8,8 @@ namespace TcUnit.Verifier
{
class FB_SkipAssertionsWhenFinished : TestFunctionBlockAssert
{
public FB_SkipAssertionsWhenFinished(ErrorItems errorItems, string testFunctionBlockInstance = null)
: base(errorItems, testFunctionBlockInstance)
public FB_SkipAssertionsWhenFinished(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
Test_LongTest();
Test_ShortTest();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using EnvDTE80;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -9,8 +8,8 @@ namespace TcUnit.Verifier
{
class FB_TestFinishedNamed : TestFunctionBlockAssert
{
public FB_TestFinishedNamed(ErrorItems errorItems, string testFunctionBlockInstance = null)
: base(errorItems, testFunctionBlockInstance)
public FB_TestFinishedNamed(IEnumerable<ErrorList.Error> errors, string testFunctionBlockInstance = null)
: base(errors, testFunctionBlockInstance)
{
Test_FinishedNamed();
}
Expand Down
Loading

0 comments on commit e4dfebd

Please sign in to comment.