~keith-penguin/kdegames/trunk

« back to all changes in this revision

Viewing changes to ksirk/ksirk/iris/src/xmpp/qa/qttestutil/testregistry.h

  • Committer: Keith Worrell
  • Date: 2009-03-18 05:35:28 UTC
  • Revision ID: keith.worrell@gmail.com-20090318053528-mx6x9c0ngmg0kg6p
imported project

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008  Remko Troncon
 
3
 * See COPYING for license details.
 
4
 */
 
5
 
 
6
#ifndef QTTESTUTIL_TESTREGISTRY_H
 
7
#define QTTESTUTIL_TESTREGISTRY_H
 
8
 
 
9
#include <QList>
 
10
 
 
11
class QObject;
 
12
 
 
13
namespace QtTestUtil {
 
14
        
 
15
        /**
 
16
         * A registry of QtTest test classes.
 
17
         * All test classes registered with QTTESTUTIL_REGISTER_TEST add 
 
18
         * themselves to this registry. All registered tests can then be run at 
 
19
         * once using runTests().
 
20
         */
 
21
        class TestRegistry
 
22
        {
 
23
                public:
 
24
                        /**
 
25
                         * Retrieve the single instance of the registry.
 
26
                         */
 
27
                        static TestRegistry* getInstance();
 
28
 
 
29
                        /**
 
30
                         * Register a QtTest test. 
 
31
                         * This method is called  by QTTESTUTIL_REGISTER_TEST, and you should 
 
32
                         * not use this method directly.
 
33
                         */
 
34
                        void registerTest(QObject*);
 
35
 
 
36
                        /**
 
37
                         * Run all registered tests using QTest::qExec()
 
38
                         */
 
39
                        int runTests(int argc, char* argv[]);
 
40
 
 
41
                private:
 
42
                        TestRegistry() {}
 
43
                
 
44
                private:
 
45
                        QList<QObject*> tests_;
 
46
        };
 
47
}
 
48
 
 
49
#endif