cancel
Showing results for 
Search instead for 
Did you mean: 

Unit test: access code in one project by another project in the same workspace

GregR
Associate

I want to setup simple unit testing using something like tinytest or minctest running on the target processor. The idea is to have the application project and a test project in the same workspace. The test project will only implement a UART for reporting results and maybe some debug LEDs. It will run the unit test code that exercises functions in the application project. I want this to be as nonintrusive of the application code as possible. I don't want to do things like breakout the code to be tested into some kind of common code section... What is the best approach? I've tried setting up linked folders but I haven't been able to make that work. I don't think it matters but the application is a netxduo project.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You can drag/drop files within the IDE and create symbolic links to the file. If you structure your files correctly, you can use the same code in both applications.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

You can drag/drop files within the IDE and create symbolic links to the file. If you structure your files correctly, you can use the same code in both applications.

If you feel a post has answered your question, please click "Accept as Solution".
mattias norlander
ST Employee

Another approach would be to keep your unit tests inside the app project in a separate folder and use different build configurations control which files that are included / excluded in unit test build vs application build.

So, there should be plenty of flexibility. Let us know if how you progress and which the major pain points are!