How to Add CppUTest toexisting Qt 5 Project?
-
I am trying to add CppUTest to a Qt5 project in Qt Creator 6.0.2. I have the CppUTest source code. I tried adding the .cpps to the project via
Right Click >> Add Existing Directory
and pointing
INCLUDEPATH += ../../Shared/cpputest-3.8/include/
to get the headers, however it still throws up compiler errors that make me think this is not set up correctly. Based on a similar question, that looks like it should be sufficient. (https://forum.qt.io/topic/84916/unit-testing-qt-code-with-cpputest/6)
However, I am getting compile errors stating there are undefined references to the PlatformSpecific family of methods. Any suggestions? Ideally I'd appreciate a step by step guide on how to set a QT project up to use CppUTest, but so far I haven't found any.
If it helps, in the cpputest-3.8/platforms/ folder, I see nothing for QT. There are folders for IAR, armcc, CCStudio, Dos, and Eclipse-Cygwin
-
Hi,
You need to link to the Cpputest libraries as well as explained in their documentation.