Unit testing Qt code with CppUTest?
-
@vdevadass "qt code" is simply C++ code, so you use it like shown here http://cpputest.github.io/.
By the way: why don't you use http://doc.qt.io/qt-5/qtest-overview.html -
yes i get qt code is c++ code but cpputest needs to understand all the data structures/types and functions part of QT, and QT framework. Hence, wouldn't i need to include some qt libraries in cpputest for it compile qt code?
For the project, we are using cpputest as standard, hence looking for a way to test qt using the same, otherwise i would have fallback to qtest.
-
@vdevadass said in Unit testing Qt code with CppUTest?:
wouldn't i need to include some qt libraries in cpputest for it compile qt code?
Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.
-
@jsulm said in Unit testing Qt code with CppUTest?:
Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.
Can you please provide more details on including header files and linking Qt libraries? this is my first time using Qt.
-
@vdevadass Please take a look here to see how to use INCLUDEPATH and LIBS libraries in pro file: http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html