????1??.pro???????QT += testlib

????QT???????qttest.pro

QT       += core testlib

TARGET = QTTest
CONFIG   += console

TEMPLATE = app

QMAKE_CXXFLAGS += --coverage
LIBS += -lgcov

DESTDIR += ./

SOURCES += main.cpp
           TestCase.cpp

HEADERS +=
           TestCase.h

INCLUDEPATH+= ./

????2??main.cpp ????????#include<QtTest/QtTest>

??????????main.cpp

#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#include <QDebug>
#include "TestCase.h"

int main(int argc?? char *argv[])
{
    qDebug() << "Test start";
    QCoreApplication a(argc?? argv);

    CTestCase TestCase;
    QTest::qExec(&TestCase);

    qDebug() << "Test end";
    return 0;
}