This repository has been archived on 2025-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
yachat/qa/guitest/guitestmanager.cpp
2025-12-25 01:38:25 +05:00

43 lines
707 B
C++

#include <QDebug>
#include "guitestmanager.h"
GUITestManager::GUITestManager()
{
}
GUITestManager* GUITestManager::instance()
{
if (!instance_) {
instance_ = new GUITestManager();
}
return instance_;
}
void GUITestManager::registerTest(GUITest* test)
{
tests_ += test;
}
bool GUITestManager::runTest(const QString& name)
{
foreach(GUITest* test, tests_) {
if (test->name() == name) {
return test->run();
}
}
qWarning() << "Test not found: " << name;
return false;
}
QStringList GUITestManager::getTestNames() const
{
QStringList test_names;
foreach(GUITest* test, tests_) {
test_names += test->name();
}
return test_names;
}
GUITestManager* GUITestManager::instance_ = NULL;