Learn Qt 5
上QQ阅读APP看书,第一时间看更新

cm-tests

Create new source/models subfolders and move client-tests.cpp there. Switch back to Qt Creator and edit cm-tests.pro:

QT += testlib
QT -= gui
TARGET = client-tests
TEMPLATE = app

CONFIG += c++14
CONFIG += console
CONFIG -= app_bundle

INCLUDEPATH += source

SOURCES += source/models/client-tests.cpp

This follows pretty much the same approach as with cm-lib, with the exception that we want a console app rather than a library. We don’t need the GUI module, but we will add the testlib module to get access to the Qt Test features.

There really isn’t much to this subproject just yet, but you should be able to run qmake and rebuild successfully.