mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
44 lines
849 B
C++
44 lines
849 B
C++
#include <QCoreApplication>
|
|
#include <QObject>
|
|
#include <QVector>
|
|
#include <QString>
|
|
#include <QDebug>
|
|
|
|
#include "test.h"
|
|
|
|
namespace {
|
|
|
|
QVector<QObject*>* suites__ = nullptr;
|
|
|
|
} // internal-linkage
|
|
|
|
TestSuite::TestSuite() {
|
|
static struct __ {
|
|
QVector<QObject*> suites_;
|
|
__() { suites__ = &suites_; }
|
|
} _;
|
|
_.suites_ << this;
|
|
}
|
|
|
|
const char* TestSuite::name() const {
|
|
return "";
|
|
}
|
|
|
|
void TestSuite::initTestCase() {
|
|
qDebug() << QString("#### Start: %1 ####").arg(name());
|
|
}
|
|
|
|
int main(int argc, char* argv[]) {
|
|
QCoreApplication app(argc, argv);
|
|
Q_UNUSED(app)
|
|
|
|
// QThread::sleep(5);
|
|
|
|
int failed_count = 0;
|
|
for (const auto& suite : (*suites__)) {
|
|
if (QTest::qExec(suite, argc, argv) != 0)
|
|
++failed_count;
|
|
}
|
|
return failed_count;
|
|
}
|