| 1 |
#ifndef MACE_H |
| 2 |
#define MACE_H |
| 3 |
|
| 4 |
#include <QObject> |
| 5 |
#include <QPointer> |
| 6 |
#include <QVariantList> |
| 7 |
|
| 8 |
|
| 9 |
namespace Mace { |
| 10 |
|
| 11 |
class Runner : public QObject |
| 12 |
{ |
| 13 |
Q_OBJECT |
| 14 |
Q_PROPERTY(int count READ count NOTIFY countChanged) |
| 15 |
public: |
| 16 |
explicit Runner(QObject *parent = 0); |
| 17 |
~Runner(); |
| 18 |
|
| 19 |
void include(QObject *tests); |
| 20 |
|
| 21 |
void include(const QString &qmlTests); |
| 22 |
|
| 23 |
template <typename T> |
| 24 |
void include(); |
| 25 |
|
| 26 |
int count() const; |
| 27 |
|
| 28 |
bool run(QStringList arguments); |
| 29 |
|
| 30 |
signals: |
| 31 |
void countChanged(); |
| 32 |
|
| 33 |
private: |
| 34 |
bool runTests(QObject *testObject, QStringList &args); |
| 35 |
bool runTests(const QString &qmlTestPath, QStringList &arguments); |
| 36 |
|
| 37 |
QVariantList m_tests; |
| 38 |
}; |
| 39 |
|
| 40 |
template<typename T> |
| 41 |
void Runner::include() |
| 42 |
{ |
| 43 |
include(new T()); |
| 44 |
} |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
#endif |