2 * This file is part of KDevelop
3 * Copyright 2008 Manuel Breugelmans <mbr.nxi@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef VERITAS_ITESTFRAMEWORK_H
22 #define VERITAS_ITESTFRAMEWORK_H
24 #include <interfaces/iextension.h>
25 #include <QVariantList>
26 #include "veritasexport.h"
29 namespace KDevelop
{ class ProjectConfigSkeleton
; }
36 /*! An extension interface for (xUnit) test frameworks. Plugins that implement this
37 * will have access to the veritas runner & result toolview.
39 * For examples see the qtest, check or cppunit implementations in
40 * kdevelop/plugins/xtest */
41 class ITestFrameworkPrivate
;
42 class VERITAS_EXPORT ITestFramework
46 virtual ~ITestFramework();
48 /*! Single word that describes the framework. eg 'QTest', 'CppUnit' */
49 virtual QString
name() const = 0;
51 /*! Factory method which constructs a test runner. To be implemented
52 * by concrete frameworks. @see Veritas::ITestRunner */
53 virtual ITestRunner
* createRunner() = 0;
55 /*! Factory method which constructs a configuration widget for this framework.
56 * Implementations should both create the widget and set the current configuration
57 * values in this widget. If null is returned, no extra config widget is present.
58 * Caller takes ownership. */
59 virtual QWidget
* createConfigWidget() { return 0; }
61 /*! Framework specific configuration. */
62 virtual KDevelop::ProjectConfigSkeleton
* configSkeleton(const QVariantList
& args
) { Q_UNUSED(args
); return 0; }
65 ITestFrameworkPrivate
* const d
;
68 /*! Initialize a ProjectConfigSkeleton [the template parameter] */
70 void initializeProjectConfig(const QVariantList
& args
) {
71 // NOTE does not quite belong here.
72 Q_ASSERT( args
.count() > 3 );
73 T::instance( args
.at(0).toString() );
74 T::self()->setDeveloperTempFile( args
.at(0).toString() );
75 T::self()->setProjectTempFile( args
.at(1).toString() );
76 T::self()->setProjectFileUrl( args
.at(2).toString() );
77 T::self()->setDeveloperFileUrl( args
.at(3).toString() );
82 KDEV_DECLARE_EXTENSION_INTERFACE_NS( Veritas
, ITestFramework
, "org.kdevelop.ITestFramework")
83 Q_DECLARE_INTERFACE( Veritas::ITestFramework
, "org.kdevelop.ITestFramework")
85 #endif // VERITAS_ITESTFRAMEWORK_H