-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking FB from development project to Testing Project #93
Comments
I'm not entirely sure I understand the problem. Do I understand it correctly that you have one project where the actual (non-testing) code is (let's call it A), and then you have another testing project (let's call it B), and in B you import the POUs from A? Why don't you add the unit tests in A? If you for some reason need them strictly separated, you can export A as a library, and use A as a library reference in B (although this adds administrate work as the combination of the two projects won't be atomic and you will need to handle that) |
Yes you're right @sagatowski , I want to test POU's of project A in project B. I would like to ask, why the referencing is not provided in twinCAT. I feel it important feature and also present in other language and IDE’s . |
The tests should not be seen as a separate entity to the software, but rather as a vital part of it, but instead of going into the theoretical discussions of this, if you want to have them as separate projects one option is to simply export the main project into a library (*.compiled-library or *.library). You simply export and install the main project as a library in your developer machine. When you export the main project as a library, you can add a reference to it in the test project. Now you have access to all the POUs in the test project. A good resource for this is: The problem with this is that it adds complexity and makes maintenance more cumbersome, as it adds more work to make sure the two are synchronized. This might work for one or two projects, but once you have a big enough project (or several projects), I'd recommend keeping these two in one solution in all other cases. |
@sagatowski Thanks for the input. |
Just as comment for info: My usecase would also be to separate testing code from production code. Especially because we deliver code to clients and don't want to hand out the testing code. |
@u-hafner If you're willing to put some time and effort into it, you could partially automate your process by having a build-server doing the creation of the library for you on your machine (after every save, or after commit to VCS for instance) by using the TwinCAT automation interface. The creation of libraries from a PLC project is included in the automation interface. |
yes, thanks. That's about the information we had with automation interface. Haven't had the time yet but we are currently preparing exactly that to hopefully automate our process. |
It worked using symbolic-links. Received one more suggestion from Here |
I have created a testing project to run unit tests using TCunit framework and wanted to link files from development project worked by another colleague.
But there is only Add option when i right click on POU folder in solution explorer of TwinCAT.
When i did so, a copy of a file is made in testing project POU folder. Now I have two copies of same file i.e. in POU folder in testing project and POU folder in development project
The problem i want is avoid is , if there are changes in the development project files i need to update POU folder in the testing project also manually.
Is there any solution to avoid the duplication?
The text was updated successfully, but these errors were encountered: