Forum Replies Created
I’ve upgraded to the custom edition of the VisualGDB
What’s the best approach to adding unit tests to an existing project?
What I tried: opening the VisualGDB properties of my current project and checking the box “this project contains unit tests based on” and selecting TinyEmbedded on the “Unit Tests” tab
But when I do this, my project doesn’t compile anymore, it throws an error saying that it can’t find the SysprogsProfilerInterface.h header being included by the SysprogsTestHooks.cpp file
But this file is present in the C:\Users\user\AppData\Local\VisualGDB\EmbeddedEFPs\Profiler folder
I’ve tried to add the path to it manually in the Include Directories but after this the error is
Error undefined reference to `SysprogsProfiler_WriteData’
Looks like something is still missing in the configuration
Right, now I realized that I got the Embedded version, thats why I was having problems. Thanks for you help
I don’t have the submenu “Unit Tests” on my “VisualGDB Project Properties” windows. See SS attached. Should it be there?
When I put the nrf5x.props file that you attached in my project it builds fine!
But the Test Explorer is not finding any tests, it just outputs “No tests found to run.”
At least the example tests in the $(ProjectName)Tests should have run right?
Attachments:You must be logged in to view attached files.
The problem was really affecting the build.
Thanks for the answer. So, actually I’m using an NRF microcontroller. But I was able to find the headers, and I just included the path to them in the “Include Directories” field in the “VisualGDB Project Properties” and now they are found! But I think it should work out of the box.
But looks like the project wasn’t finding the .c files. So, I added the whole
folder to my project. And now the problem is:
<h5>\Local\VisualGDB\TestFrameworks\com.sysprogs.unittest.tinyembtest\SysprogsTestHooks.cpp(87,5): error : ‘pthread_mutex_t’ does not name a type; did you mean ‘pthread_atfork’?
1> pthread_mutex_t m_Mutex;</h5>
Looks like it’s not finding the pthread-related files. I even added the <pthread.h> header to the SysprogsTestHooks.cpp file (and the it is being found), but still got the same problem.
Can you help me with this? Maybe it is something related to Windows since pthread.h is Unix-related