mirror of
https://github.com/YACReader/yacreader
synced 2025-09-08 06:14:53 -04:00
Update QsLog to 2.1 snapshot 46b643d5bcbc
This commit is contained in:
30
third_party/QsLog/unittest/QtTestUtil/TestRegistry.cpp
vendored
Normal file
30
third_party/QsLog/unittest/QtTestUtil/TestRegistry.cpp
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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;
|
||||
foreach(QObject* test, tests_) {
|
||||
result |= QTest::qExec(test, argc, argv);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user