Library Manager -> Library Parameters (near placeholders) There you can change parameters like the max number of test suites, the max number of tests per test suite or the max number of asserts per test
this can be closed BTW
I think this is the same or similar to https://forge.codesys.com/lib/counit/tickets/58/ I figured out that this was occurring because assert was being called continuously
For security reasons, we had to shut down the faq.codesys.com page. The content will gradually be integrated into the CODESYS Online Help System (https://www.helpme-codesys.com). Here the preliminary faq file for download.
Seems to work now. Can this be closed?
Request: Tutorial for Jinkins and example Python Scripts
AccessViolation Exception thrown in FB_AssertResultStatic.AddAssertResult()
For anyone looking for a solution to a similar problem: * You should install a newer version of CodeSys (e.g. 3.5 SP19) * Open newer version of CodeSys * Import the project * Click File > Save Project as * Select the appropriate file type according to the target CodeSys version - in case of CodeSys 3.5 SP11 select Library files (CODESYS V3.5 SP11) (*.library) * Click Save Now you will be able to open the .library with the target CodeSys version.
For anyone looking for a solution to a similar problem: * You should install a newer version of CodeSys (e.g. 3.5 SP19) * Open newer version of CodeSys * Import the project * Click File > Save Project as * Select the appropriate file type according to the target CodeSys version - in case of CodeSys 3.5 SP19 select Library files (CODESYS V3.5 SP11) (*.library) * Click Save Now you will be able to open the .library with the target CodeSys version.
CoUnit Library installation error in CodeSys 3.5 SP11
Can you give me an example on how this should look like?
Hi, Yes it seems the program will not fit in your PLC memory. To resole this you can use the parameters in the CoUnit library to limit the various array sizes.
coUnitRunner Error: no more free global space
Hi, this might help you: https://forge.codesys.com/tol/codesys-4-linux/docker/ci/master/tree/codesys-ide/scripts/ Won't run out of the box i guess, but it gives a good idea on how scripting CODESYS works.
Thanks for the response! I am already building my libraries and packaging them in Jenkins. I am running SP17 so I can't take advantage of the SP19 feature. I'll have a look at bug 63. Ideally, the test results would be stored in the Jenkins build folder. This would allow concurrent running of builds. Really what I wanted to know is if someone could share the actual python script or include it in the library or in the documentation. In my experience, the largest challenge is to come up with what you...
Thanks for the response! I am already building my libraries and packaging them in Jenkins. I am running SP17 so I cant take advantage of the SP19 feature. Ill have a look at bug 63. Really what I wanted to know is if you could share the actual python script or include it in the library or in the documentation. In my experience, the largest challenge is to come up with what you call: "your script file which monitors the xUnit xml-file has been dumped and exits CODESYS afterwards.py" If you have such...
Thanks for the response! I am already building my libraries and packaging them in Jenkins. I am running SP17 so I cant take advantage of the SP19 feature. Ill have a look at bug 63. Really what I wanted to know is if you could share the actual python script or include it in the library or in the documentation. In my experience, the largest challenge is to come up with what you call: "<your script="" file="" which="" monitors="" the="" xunit="" xml-file="" has="" been="" dumped="" and="" exits=""...
Jenkins python scripts
Jenkins python scripts
Hi, A small primer on how to go started. You should not change the path of the xml file via Python unless you fancy a challenge. Try changing via the supposed manner: via the new lib parameter interaction window (SP19 or newer) or change it in the .library and save it (recommended for older then SP19). The lib is open source so you may do whatever you see fit. I suggest you open the lib and explore/read it as this will help you write code for step2, monitoring the successful dump of the XML file...
Jenkins python scripts
Hi, A small primer on how to go started. You should not change the path of the xml file via Python unless you fancy a challenge. Try changing via the supposed manner: via the new lib parameter interaction window (SP19 or newer) or change it in the .library and save it (recommended for older then SP19). The lib is open source so you may do whatever you see fit. I suggest you open the lib and explore/read it as this will help you write code for step2, monitoring the successful dump of the XML file...
Jenkins python scripts
you are most likely affected by this security fix: Codesys Advisory 2023-01 get the files from Program data or change that setting (Forceiecfilepath) to zero. hope this gives you enough hints
you are probably affected by this security fix: Codesys Advisory 2023-01
1) If you keep the default directory, is the file written? => The anwser should be YES if the unittest doesn't hang (i.e all test finish regardless outcome). 2) If you change the Default directory, is the file written? => If No: - check your PATH notation in CODESYS(!), - check the file write FB error messages, - check if the unittest doesn't hang (i.e all test finish regardless outcome). The XML file is only dumped at the end of all the tests. If the xml file is incomplete, assign a bigger filebuffer...
Its quite simple: the main fault was most probably somewhere in your filepath syntax. Read up on the FileRead/FileWrite/FileOpen and FileClose FB's from CAA File Library for hints on the path's syntax: CAA.FILENAME which is described in “CAA_Types.library“ should be usable for library “CAA_File“ in the following way. Separators between directory paths in “CAA.FILENAME“ are the slash („/“) or the back-slash („\“). The interpretation of the directory path is tolerant to the effect that either one or...
Wait I found it. It seems it ignores the "C:\" I changed the path to just the file name 'coUnit_xunit_testresults.xml' and then I found it written to C:\ProgramData\CODESYS\CODESYSControlWinV3x64\B4A102F1\PlcLogic Is is rather confusing. Where is it writing to if I put C:\ on it? it says it is suceeding.
Wait I found it. It seems it ignores the "C:\' and puts it in a temp folder in ProgramData C:\ProgramData\CODESYS\CODESYSControlWinV3x64\B4A102F1\PlcLogic Is is rather confusing.
I am confused. As I said in my post 1. using the default directory which is set to 'C:\' in the library parameter list results in all log messages to the device log showing success. there are no error messages. 2. Changing the directory to C:\Temp\ has the same result all show sucess, and no error mesages. but the xml file is not there in either case. This is the export of the log entries runing the test using the default path <LoggerEntries xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...
I am confused. As I said in my post 1. using the default directory which is set to 'C:\' in the library parameter list results in all log messages to the device log showing success. there are no error messages. 2. Changing the directory to C:\Temp\ has the same result all show sucess, and no error mesages. but the xml file is not there in either case. This is the log entries with default path <LoggerEntries xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...
I am confused. As I said in my post 1. using the default directory which is set to 'C:\' in the library parameter list results in all log messages to the device log showing success. there are no error messages. 2. Changing the directory has the same result all show sucess, and no error mesages. but the xml file is not there in either case. This is the log entries with default path <LoggerEntries xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Logger...
1) If you keep the default directory, is the file written? => The anwser is YES if the unittest doesn't hang (i.e all test finish regardless outcome). 2) If you change the Default directory, is the file written? => If No: - check your PATH notation in CODESYS(!), - check the file write FB error messages, - check if the unittest doesn't hang (i.e all test finish regardless outcome). The XML file is only dumped at the end of all the tests. If the xml file is incomplete, assign a bigger filebuffer until...
Test Suite is not being Executed
xml Results file not being written to file system
Ok it appears it will only execute once and then will require a reset and not just a start and stop. So I figured that out. Next problem This can be closed
Ok it appears it will only execute once and then will require a reset and not just a start and stop. So I figured that out. Next problem
Test Suite is not being Executed
AssertResults array not checked for upper bounds
The library is open source, you can edit the source code if you wish.
AssertResults array not checked for upper bounds
I had the same problem just today with coUnit v1.2.0.0. Library parameters are not editable so I cannot increment the related array size.
I've caught so many bugs in my code. From silly mistakes to big head scratchers. Massive thanks guys
Userlist
Home
Home
AssertEquals_REAL does not handle NaN
AssertEquals_REAL does not handle NaN
AssertEquals_REAL does not handle NaN
Userlist
Hi, first off let me start by thanking you for using our unit testing framework solution. As you might know allready this software is an official fork of TcUnit. Therefore, we try to follow the original TcUnit codebase as close as possible or technically permitted. For instance, ADS will not work without a proper implementation in CODESYS, but a bespoke CI/CD runner is not necessary like in TwinCAT3. So there are pro's and con's. Currently we are waiting for the release of TcUnit v1.3 (or V2?). When...
Hi, first off let me start by thanking you for using our unit testing framework solution. As you might know allready this software is an official fork of TcUnit. Therefore, we try to follow the original TcUnit codebase as close as possible or technically permitted. For instance ADS will not work in CODESYS, but a bespoke CI/CD runner is not necessary like in TwinCAT3. So there are pro's and con's. Currently we are waiting for the release of TcUnit v1.3 (or V2?). When it is officially released, you...
Attached a tentative solution for the problem, patch for the FB_AssertResultStatic.ReportResult method, based on what's implemented in FB_AssertArrayResultStatic.ReportResult.
FB_AssertResultStatic.ReportResult - PLC Crash
Home
Home
Home
See the attached files. Yes, this is in v1.2.0.0
AssertEquals_REAL does not handle NaN
Hi John, We are aware that certain details in the framework are sub optimal. However, that said, every tip/hint we get to optimise is one step in the right direction. So, since you found this issue, I hope you could also submit a patch which catches the Not A Number status and yields a fail in the assert. You can submit your patch in multiple ways. My suggestion would be that you just drop a code here in the Ticket. The reason behind this because I dont know if you hvae the Professional Developer...
A note about this. It seems that if all the variables in the function I'm testing are 0.0 then the math can return NaN however if only the divisor (rl2) is 0.0 then the controller will throw a divide-by-zero exception. FUNCTION ExampleFunction : REAL VAR_INPUT rl1 : REAL; rl2 : REAL; rl3 : REAL; END_VAR ExampleFunction := (rl1 / rl2) * rl3; It is interesting the things you discover as you create more test cases. (Thanks for your work on this library <3 )
A note about this. It seems that if all the variables in the function I'm testing are 0.0 then the math can return NaN however if only the divisor (r2) is 0.0 then the controller will throw a divide-by-zero exception. FUNCTION ExampleFunction : REAL VAR_INPUT rl1 : REAL; rl2 : REAL; rl3 : REAL; END_VAR ExampleFunction := (r1 / r2) * r3; It is interesting the things you discover as you create more test cases. (Thanks for your work on this library <3 )
AssertEquals_REAL does not handle NaN
FAQ page not working
AssertResults array not checked for upper bounds
Since I have not received feedback and you make use of an older version, I asume this has been resolved. If somehow your issue persists in the latest version ( v1.2) you can open a new ticket.
Since I have not received feedback and use an outdated version I asume this has been resolved. If somehow your issue persists in the latest version ( v1.2) you can open a new ticket.
Home
Home
Home
Thank you for using cfUnit. Sadly cfunit v1.1.0.0 will not receive bugfixes as it has been superseeded by coUnit. A slightly different name will only bring you some minor code changes if you use refactoring wisely, however coUnit v1.2.0.0 also brings new features, improvements and bugfixes over its predecessor. So step 1 is to update to coUnit.
AssertResults array not checked for upper bounds
Home
Autoversioning commit: a non-deltaV client made a change to
Autoversioning commit: a non-deltaV client made a change to
Autoversioning commit: a non-deltaV client made a change to
Create .yml pipeline and tuned manifest
Ignore my previous message. In the meanwhile I confirmed the real issue, now searching for root cause
XSD https://forge.codesys.com/prj/cfunit/code/HEAD/tree/trunk/coUnit/XSD/JUnitv5.xsd Compliance https://forge.codesys.com/prj/cfunit/code/HEAD/tree/trunk/coUnit/XSD/QA%20xUnit.xml%20template.png?format=raw
Add ability to disable tests and have them reported
XSD https://forge.codesys.com/prj/cfunit/code/HEAD/tree/trunk/coUnit/XSD/JUnitv5.xsd Compliance (non debatable here) https://forge.codesys.com/prj/cfunit/code/HEAD/tree/trunk/coUnit/XSD/QA%20xUnit.xml%20template.png?format=raw
Since this ticket is fulfilled within scope I will close the issue.
Did some digging on the format and I can't seem to find disabled as an attribute in the xsd (https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd) however skipped is mentioned, but in the context of <testsuite>
It seems it is not reported as disabled in the xml report or in the log. (See attached screen shots), but is reported as SKIPPED in the test suite. Maybe I misunderstand the disabled field for <testsuites> I was expecting that to give the total disabled or skipped tests. It does get marked as skipped, but calling TEST_FINISHED() doesn't mark it finished. (Not sure if it should)
If you declare a test, calling TEST_FINISHED() is mandatory, even if the test will be disabled; TEST('DISABLED_ThisTestWillBeIgnored'); AssertEquals(Expected := a, Actual := b, Message := 'A does not equal B'); TEST_FINISHED(); Note that 'Disabled' is case insensitive.
If you declare a test, calling TEST_FINISHED() is mandatory, even if the test will be disabled; TEST('DISABLED_ThisTestWillBeIgnored'); AssertEquals(Expected := a, Actual := b, Message := 'A does not equal B'); TEST_FINISHED();
Does TEST_FINISHED() need to be called when the test is marked as disabled_? or is it sufficient to just have it marked as skipped/disabled? METHOD T101_Process VAR_INPUT END_VAR VAR_INST mxT : UINT; END_VAR IF xLiveDB THEN TEST('T101_Process'); ELSE // gc_sDisable : STRING(10) := 'disabled_'; TEST(concat(gConst.gc_sDisable, 'T101_Process')); // Is this call necessary? TEST_FINISHED(); RETURN; END_IF CASE mxT OF 0: // init mxT := 10; 10: // multi stage test mxT := 20; ELSE TEST_FINISHED(); END_C...
Add ability to disable tests and have them reported
Hi, maybe it is an undocumented feature(?) but your request is allready implemented into v1.2.0.0 :-) AFAIK Use Test('Disabled_TestXYZ'); Test_Finished(); This will be counted in the reporting as a skipped test. (both logged in PLC Log and in the XML.report)
Add ability to disable tests and have them reported
Home
Home
Home
Home
Home
Home
Home
Home