Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions TcUnit/TcUnit/GVLs/GVL_Param_TcUnit.TcGVL
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ VAR_GLOBAL CONSTANT
MaxNumberOfTestSuites : UINT := 1000;
MaxNumberOfTestsForEachTestSuite : UINT := 100;
MaxNumberOfAssertsForEachTestSuite : UINT := 1000;

(* TcUnit logs complete test results. These include:
- Number of test suites
- Number of tests
- Number of successful tests
- Number of failed tests
- Any eventual failed assertion (with the expected & actual value plus an user defined message)
These are all printed to the ADS logger (Visual Studio error list) marked with ERROR criticality

On top of this TcUnit also reports some statistics/extended information with HINT/INFO criticality.
- Number of test suites
- Number of tests
- Number of successful tests
- Number of failed tests
- Any eventual failed assertion (with the expected & actual value plus an user defined message)
These are all printed to the ADS logger (Visual Studio error list) marked with ERROR criticality *)
AdsLoggerEnablePublish : BOOL := TRUE;


(* On top of the normal result, TcUnit also reports some statistics/extended information with HINT/INFO criticality.
These statistics are more detailed results of the tests. This information is used when results are
being collected by an external software (such as TcUnit-Runner) to do for example Jenkins integration.
This extra information however takes time to print, so by setting the following parameter to FALSE
Expand Down
2 changes: 1 addition & 1 deletion TcUnit/TcUnit/POUs/FB_AdsLogStringMessageFifoQueue.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ VAR
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[// Only log message types of ERROR if log extended results is not enabled
IF MsgCtrlMask = ADSLOG_MSGTYPE_ERROR OR GVL_Param_TcUnit.LogExtendedResults THEN
IF GVL_Param_TcUnit.AdsLoggerEnablePublish AND_THEN (MsgCtrlMask = ADSLOG_MSGTYPE_ERROR OR GVL_Param_TcUnit.LogExtendedResults) THEN
AdsLogStringMessage.MsgCtrlMask := MsgCtrlMask;
AdsLogStringMessage.MsgFmtStr := MsgFmtStr;
AdsLogStringMessage.StrArg := StrArg;
Expand Down
2 changes: 1 addition & 1 deletion TcUnit/TcUnit/POUs/FB_AdsTestResultLogger.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[TcUnitTestResults REF= TestResults.GetTestSuiteResults();

IF PrintingTestSuiteResultNumber <= GVL_TcUnit.NumberOfInitializedTestSuites AND NOT PrintedTestSuitesResults THEN
IF PrintingTestSuiteResultNumber <= GVL_TcUnit.NumberOfInitializedTestSuites AND_THEN NOT PrintedTestSuitesResults THEN
PrintingTestSuiteTrigger(CLK := GVL_TcUnit.TestSuiteAddresses[PrintingTestSuiteResultNumber]^.AreAllTestsFinished());
IF PrintingTestSuiteTrigger.Q THEN
StringToPrint := CONCAT(STR1 := '| Test suite ID=',
Expand Down