diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-08-11 15:59:09 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-08-14 11:16:34 +0200 |
commit | 09d9ce2c265450d786052100bedb059870dddc23 (patch) | |
tree | 3e811fa1a328a8d19ddbffec5a94d2c61add84fc /tests/auto/api/testdata/qt5-plugin | |
parent | 4e7f1023b0fc1349047357cf8926fa68761cc546 (diff) |
Turn some blackbox tests into API tests.
Different test executables can run in parallel, whereas the functions
within one test executable cannot. This means that tst_blackbox is
currently a bottleneck, as it takes an order of magnitude longer
than all other tests combined. We therefore turn a number of blackbox
tests into API tests (most tests work equally well in either).
The run-time of these two test executables is now about the same, and as
a result, the time it takes to run "make check" has almost halved.
Change-Id: I55ef43a60588f86a8438bdecb7795aca0880efd0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/api/testdata/qt5-plugin')
6 files changed, 93 insertions, 0 deletions
diff --git a/tests/auto/api/testdata/qt5-plugin/echointerface.h b/tests/auto/api/testdata/qt5-plugin/echointerface.h new file mode 100644 index 000000000..228a911e6 --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/echointerface.h @@ -0,0 +1,24 @@ + +#ifndef ECHOINTERFACE_H +#define ECHOINTERFACE_H + +#include <QString> + +//! [0] +class EchoInterface +{ +public: + virtual ~EchoInterface() {} + virtual QString echo(const QString &message) = 0; +}; + + +QT_BEGIN_NAMESPACE + +#define EchoInterface_iid "org.qt-project.Qt.Examples.EchoInterface" + +Q_DECLARE_INTERFACE(EchoInterface, EchoInterface_iid) +QT_END_NAMESPACE + +//! [0] +#endif diff --git a/tests/auto/api/testdata/qt5-plugin/echoplugin.cpp b/tests/auto/api/testdata/qt5-plugin/echoplugin.cpp new file mode 100644 index 000000000..b6747a82b --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/echoplugin.cpp @@ -0,0 +1,6 @@ +#include "echoplugin.h" + +QString EchoPlugin::echo(const QString &message) +{ + return message; +} diff --git a/tests/auto/api/testdata/qt5-plugin/echoplugin.h b/tests/auto/api/testdata/qt5-plugin/echoplugin.h new file mode 100644 index 000000000..9f8d71c5c --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/echoplugin.h @@ -0,0 +1,19 @@ + +#ifndef ECHOPLUGIN_H +#define ECHOPLUGIN_H + +#include <QObject> +#include <QtPlugin> +#include "echointerface.h" + +class EchoPlugin : public QObject, EchoInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json") + Q_INTERFACES(EchoInterface) + +public: + QString echo(const QString &message); +}; + +#endif diff --git a/tests/auto/api/testdata/qt5-plugin/echoplugin.json.source b/tests/auto/api/testdata/qt5-plugin/echoplugin.json.source new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/echoplugin.json.source @@ -0,0 +1 @@ +{} diff --git a/tests/auto/api/testdata/qt5-plugin/echoplugin_dummy.cpp b/tests/auto/api/testdata/qt5-plugin/echoplugin_dummy.cpp new file mode 100644 index 000000000..baa060d28 --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/echoplugin_dummy.cpp @@ -0,0 +1 @@ +void dummyFunc() {} diff --git a/tests/auto/api/testdata/qt5-plugin/project.qbs b/tests/auto/api/testdata/qt5-plugin/project.qbs new file mode 100644 index 000000000..2944198f3 --- /dev/null +++ b/tests/auto/api/testdata/qt5-plugin/project.qbs @@ -0,0 +1,42 @@ +import qbs.base +import qbs.File +import qbs.FileInfo + +DynamicLibrary { + name: "echoplugin" + + Depends { name: "Qt.core" } + Depends { name: "cpp" } + + Group { + condition: Qt.core.versionMajor >= 5 + files: [ + "echoplugin.h", + "echoplugin.cpp", + "echoplugin.json.source" + ] + } + Group { + condition: Qt.core.versionMajor < 5 + files: "echoplugin_dummy.cpp" + } + + cpp.includePaths: buildDirectory + + Transformer { + condition: Qt.core.versionMajor >= 5 + inputs: ["echoplugin.json.source"] + Artifact { + filePath: "echoplugin.json" + fileTags: ["qt_plugin_metadata"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + FileInfo.fileName(output.filePath); + cmd.sourceCode = function() { + File.copy(input.filePath, output.filePath); + } + return cmd; + } + } +} |