mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
32 lines
580 B
C++
32 lines
580 B
C++
/*
|
|
* Copyright (C) 2008 Remko Troncon
|
|
* Licensed under the MIT license.
|
|
* See COPYING for license details.
|
|
*/
|
|
|
|
#include "QtTestUtil/TestRegistry.h"
|
|
|
|
#include <QtTest/QtTest>
|
|
|
|
namespace QtTestUtil {
|
|
|
|
TestRegistry* TestRegistry::getInstance() {
|
|
static TestRegistry registry;
|
|
return ®istry;
|
|
}
|
|
|
|
void TestRegistry::registerTest(QObject* test) {
|
|
tests_ += test;
|
|
}
|
|
|
|
int TestRegistry::runTests(int argc, char* argv[]) {
|
|
int result = 0;
|
|
const auto &tests = tests_;
|
|
for (auto *test : tests) {
|
|
result |= QTest::qExec(test, argc, argv);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
}
|