[r321]: / trunk / Library / POUs / FB_TestResults / svnobj  Maximize  Restore  History

Download this file

5 lines (5 with data), 13.1 kB

Gx_l3!0…jüoă*>ŤIr:±TŃSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagTextx(* The body of the function block stores the test results *)ŢIF StoringTestSuiteResultNumber <= GVL_CfUnit.NumberOfInitializedTestSuites AND NOT StoredTestSuiteResults THENî    StoringTestSuiteTrigger(CLK := GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.AreAllTestsFinished());J    IF StoringTestSuiteTrigger.Q THENž        (* Remove everything except the program name + "." + test suite name *)č        TestSuiteName := F_RemoveInstancePathAndProjectNameFromTestInstancePath(TestInstancePath := GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetInstancePath());T        (* Store test suite name and ID *)Ľ        TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].Name := TestSuiteName;ę        TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].Identity := StoringTestSuiteResultNumber - 1;b        (* Store number of tests in test suite *)°        TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].NumberOfTests :=¸            GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetNumberOfTests();p        (* Store number of failed tests in test suite *)Ľ        TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].NumberOfFailedTests :=Ä            GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetNumberOfFailedTests(); n        (* Iterate and print all tests in test suite *)!†        FOR TestsInTestSuiteCounter := 1 TO GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetNumberOfTests() BY 1 DO"Ś            TestToBeStored := GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetTestByPosition(TestsInTestSuiteCounter);#B            (* Store test name *)$´            TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestName := TestToBeStored.GetName();%N            (* Store test class name *)&Š            TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].TestClassName :='®                F_RemoveInstancePathAndProjectNameFromTestInstancePath(GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.GetInstancePath());(x            (* Store the (first failed) assertion message *))Ś            TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureMessage :=*j                TestToBeStored.GetAssertionMessage();+           ,r            (* Store the (first failed) assertion type *)-†            TestSuiteResults.TestSuiteResults[StoringTestSuiteResultNumber].TestCaseResults[TestsInTestSuiteCounter].FailureType :=.d                TestToBeStored.GetAssertionType();/		END_FOR0®        IF StoringTestSuiteResultNumber = GVL_CfUnit.NumberOfInitializedTestSuites THEN1V            StoredTestSuiteResults := TRUE;2        ELSE3š            StoringTestSuiteResultNumber := StoringTestSuiteResultNumber + 1;4        END_IF5~        StoringTestSuiteTrigger(CLK := FALSE); // Reset trigger6    END_IF7END_IF8ś(* If all test suites have finished running, store the general test results *)9śIF StoringTestSuiteResultNumber = GVL_CfUnit.NumberOfInitializedTestSuites AND:ş   GVL_CfUnit.TestSuiteAddresses[StoringTestSuiteResultNumber]^.AreAllTestsFinished() AND NOT;@   StoredGeneralTestResults THEN<   =¨    TestSuiteResults.NumberOfTestSuites := GVL_CfUnit.NumberOfInitializedTestSuites;>Č    FOR GeneralTestResultsTestSuitesCounter := 1 TO GVL_CfUnit.NumberOfInitializedTestSuites BY 1 DO?Đ        TestSuiteResults.NumberOfTestCases := TestSuiteResults.NumberOfTestCases + TestSuiteResults.TestSuiteResults[GeneralTestResultsTestSuitesCounter].NumberOfTests;@Ě        TestSuiteResults.NumberOfSuccessfulTestCases := TestSuiteResults.NumberOfSuccessfulTestCases +Až                                                        (TestSuiteResults.TestSuiteResults[GeneralTestResultsTestSuitesCounter].NumberOfTests -BŞ                                                         TestSuiteResults.TestSuiteResults[GeneralTestResultsTestSuitesCounter].NumberOfFailedTests);Cô        TestSuiteResults.NumberOfFailedTestCases := TestSuiteResults.NumberOfFailedTestCases + TestSuiteResults.TestSuiteResults[GeneralTestResultsTestSuitesCounter].NumberOfFailedTests;D	END_FOREJ    StoredGeneralTestResults := TRUE;FInterfaceGL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}HÄ(* This function block holds results of the complete test run, i.e. results for all test suites *)I:FUNCTION_BLOCK FB_TestResultsJVARK*    (* Test results*)LV    TestSuiteResults : ST_TestSuiteResults;M    N0    (* Misc variables *)O¦    StoringTestSuiteResultNumber : UINT(1..GVL_Param_CfUnit.MaxNumberOfTestSuites);PJ    StoringTestSuiteTrigger : R_TRIG;QD    StoredTestSuiteResults : BOOL;RH    StoredGeneralTestResults : BOOL;SEND_VARTVAR_TEMPU@    TestSuiteName : T_MaxString;V6    TestName : T_MaxString;W˛    TestsInTestSuiteCounter : UINT(1..GVL_Param_CfUnit.MaxNumberOfTestsForEachTestSuite);X:    TestToBeStored : FB_Test;Y´    GeneralTestResultsTestSuitesCounter : UINT(1..GVL_Param_CfUnit.MaxNumberOfTestSuites);Z"UniqueIdGenerator[300\POULevel]L{8e575c5b-1d37-49c6-941b-5c0ec7874787}^Standard_ ChildObjectGuids`8System.Collections.ArrayLista,AddAttributeSubsequentbboolĐĐ-ĐĐ	E
>ĐĐ
­îÚĐ-ĐĐ
­ďÚĐ-ĐĐ
­đÚĐ-ĐĐ
­ńÚĐ-ĐĐ
­ňÚĐ-ĐĐ
­óÚĐ-ĐĐ
­ôÚĐ-ĐĐ
­őÚĐ-ĐĐ
­öÚĐ-ĐĐ
­÷ÚĐ-ĐĐ
­řÚĐ-ĐĐ
­ůÚĐ-ĐĐ
­úÚĐ-ĐĐ
­űÚĐ-ĐĐ
­üÚĐ-ĐĐ
­ýÚĐ-ĐĐ
­ţÚĐ-ĐĐ
­˙ÚĐ-ĐĐ
­ÚĐ-ĐĐ
­ÚĐ- ĐĐ
­ÚĐ-!ĐĐ
­ÚĐ-"ĐĐ
­ÚĐ-#ĐĐ
­ÚĐ-$ĐĐ
­ÚĐ-ĐĐ
­ÚĐ-%ĐĐ
­ÚĐ-&ĐĐ
­	ÚĐ-'ĐĐ
­
ÚĐ-ĐĐ
­ÚĐ-(ĐĐ
­ÚĐ-)ĐĐ
­
ÚĐ-*ĐĐ
­ÚĐ-+ĐĐ
­ÚĐ-,ĐĐ
­ÚĐ--ĐĐ
­ÚĐ-.ĐĐ
­ÚĐ-/ĐĐ
­ÚĐ-ĐĐ
­ÚĐ-0ĐĐ
­ÚĐ-1ĐĐ
­ÚĐ-2ĐĐ
­ÚĐ-3ĐĐ
­ÚĐ-4ĐĐ
­ÚĐ-5ĐĐ
­ÚĐ-6ĐĐ
­ÚĐ-7ĐĐ
­ÚĐ-ĐĐ
­ÚĐ-8ĐĐ
­ÚĐ-9ĐĐ
­ÚĐ-:ĐĐ
­ ÚĐ-;ĐĐ
­!ÚĐ-<ĐĐ
­"ÚĐ-=ĐĐ
­#ÚĐ->ĐĐ
­$ÚĐ-?ĐĐ
­%ÚĐ-@ĐĐ
­&ÚĐ-AĐĐ
­'ÚĐ-BĐĐ
­(ÚĐ-CĐĐ
­)ÚĐ-DĐĐ
­*ÚĐ-EĐĐ
­tÚĐ-7ĐFGĐ	E
ĐĐ
­ÚÚĐ-HĐĐ
­ŰÚĐ-IĐĐ
­ÜÚĐ-JĐĐ
­ÝÚĐ-KĐĐ
­ŢÚĐ-LĐĐ
­ßÚĐ-MĐĐ
­ŕÚĐ-NĐĐ
­áÚĐ-OĐĐ
­âÚĐ-PĐĐ
­ăÚĐ-QĐĐ
­äÚĐ-RĐĐ
­ĺÚĐ-SĐĐ
­ćÚĐ-TĐĐ
­çÚĐ-UĐĐ
­čÚĐ-VĐĐ
­éÚĐ-MĐĐ
­ęÚĐ-WĐĐ
­ëÚĐ-MĐĐ
­ěÚĐ-XĐĐ
­íÚĐ-YĐĐ
­ÚĐ-SĐZ-[Đ\]-^_`Đab­