FB_TestSuite.SetTestFinished should be:
IF NumberOfTests > 0 THEN
FOR IteratorCounter := 1 TO NumberOfTests BY 1 DO
IF Tests[IteratorCounter].GetName() = TestName THEN
Tests[IteratorCounter].SetFinished();
SetTestFinished := TRUE;
RETURN;
END_IF
SetTestFinished := FALSE;
END_FOR
END_IF
if not for the return, the method resets the flag immediately after setting it. It might also clear other set flags.
Hi,
Thank you for your effort in this matter.
In which CfUnit version have you found this omission?
Would you mind switching to RC4 and confirm if this omission is in there also? RC4 can be found in the trunk, but must be compiled!) It is not the binary version (RC3) sorry for this.
If you would kindly supply this information, so we can check this issue upstream also.
With kind regards,
The CfUnit Team
I don't have SVN, so I used the library in the snapshot, which is 1.0.9.93.
I also looked in the online code repository, and didn't see the return line.
The reason I debugged this code in the first place was I used TEST_FINISHED_NAMED to solve the issue I had with parallel multi-cycle tests, and I got an error:
Failed to find test 'XXXX'.
When I stepped through the function I saw that when the test was found, the method called
SetTestFinished := TRUE;
exited the IF block and then
SetTestFinished := FALSE;
Hi,
Thank you for bringing this to our attention! It really helps bringing the CfUnit Unit Testing framework to maturity.
Would you be so kind and send a .projectarchive of your fixed project and fixed CfUnit library?
I will use them in my testing procedure;
I'll reproduce your issue using your project and the original RC3 candidate,
Then I'll reproduce your issue using your project and the original RC4 candidate.
Afterwards I'll use your suggestion to patch a preliminary RC5 to verify the correct working on the CfUnit verifier and the timed test.
If the verification of the CfUnit verifier and the TimedTest work as intended, I'll release the patched RC5 binary which will contain this fix in the trunk both binary and as SVN.
Please update your CfUnit framework to the latest version when it shall be made available.
With kind regards,
The CfUnit team
PS.
Tip: SVN can downloaded for free and used for free in combination with cForge without a license as the cForge realm is whitelisted by 3S in the SVN plugin
Diff:
Attached CfUnit project archive
RC5 in the trunk is tested and fixes this issue
Hi,
Would you please provide feedback whether the solution has helped?
Thank you.
I just downloaded RC5. The RETURN statement I suggested adding in the first post was not found in the SetTestFinished method, so I still encounter the same behavior.
After re-adding the RETURN statement everything works as expected.
So the ticket is not solved.
Thank you for the feedback.
Sorry to hear your problem with named tests still persists, so we will recheck this: To be continued.
PS.
You can add RETURN in your own copy of the code for now as a quick workaround. Hope this helps you in the mean time.
upstream code available at
https://github.com/tcunit/TcUnit/blob/master/TcUnit/TcUnit/POUs/FB_TestSuite.TcPOU#L3750
I'll test this tonight
Fixed this issue in RC5.1 for download now