Replies: 2 comments 1 reply
-
Is there any reason why the tests are not in the same project as the code? Maybe this could be an option? |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks! I'll try the symbolic link option. I didn't know it was possible to do so under Windows. Interested to see if the linking information is kept intact going though git. If it does, my original problem is solved. Why I want to do this is a good question. One concern is to keep the test code out of the production code. This could also be achieved by using conditional pragmas to disable running TCunit if the project is set to "release". The other reason is the way I've implemented my interface. I guess I could have used some more flexible way of connection my code to the rest of the application. A part of my code implements a command interface. Commands are sent as JSON object trough MQTT and parsed in my code. If I for instance get a abort command, I call the appropriate function in the application in order to abort. Could I have implemented this in a way where I initiate my function block with a list of pointers to the functions for I.E. abort. And that way have the ability to connect my function block to mock function in the unit test? Figuring this out might solve the underlying problem of my code being to closely woven into the rest of the application. Bernie |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm fairly new to both Beckhoff/CODESYS and TCunit. I use git for version control.
I have a project where I had my tests running just fine until my colleague implemented some more functionality. My code (and test code) is parsing JSON objects received via MQTT. I have not made any mockup function or similar. The tests are now dependent on code outside the test scope. Not good. I separated all the tests and the code they test into a parallel project (in the same solution). But I can't get XAE to use the same files for both projects. If I select "add existing items", XAE copies the files to a new location. This is not good either.
Is there a way to have these two project share the files and not relay upon copying files?
Or another way of addressing this issue?
Bernie
Beta Was this translation helpful? Give feedback.
All reactions