[Kst] branches/work/kst/portto4/kst
Adam Treat
treat at kde.org
Wed Sep 26 02:56:05 CEST 2007
SVN commit 717071 by treat:
* And voila, test suite now works and datasource passes :)
M +1 -1 run-tests
M +15 -10 src/libkst/kstdatasource.cpp
M +1 -1 tests/main.cpp
M +7 -13 tests/testdatasources.cpp
M +2 -0 tests/tests.pro
--- branches/work/kst/portto4/kst/run-tests #717070:717071
@@ -5,4 +5,4 @@
export SCRIPTDIR=$PWD
export BUILDDIR=$PWD/build
-echo " !IMPLEMENT ME PLEASE! "
+$BUILDDIR/bin/runtests "$@"
--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.cpp #717070:717071
@@ -24,6 +24,7 @@
#include <qdir.h>
#include <qfile.h>
#include <qfileinfo.h>
+#include <qlibraryinfo.h>
#include <qpluginloader.h>
#include <qtextdocument.h>
#include <qurl.h>
@@ -97,9 +98,6 @@
KstDebug::self()->log(i18n("Scanning for data-source plugins."));
- //const QDir pluginsDir = QDir(qApp->applicationDirPath());
- const QDir pluginsDir = QDir("/home/kde/build/home/kde/branches/work/kst/portto4/lib");
-
foreach (QObject *plugin, QPluginLoader::staticInstances()) {
//try a cast
if (KstDataSourcePluginInterface *ds = qobject_cast<KstDataSourcePluginInterface*>(plugin)) {
@@ -107,14 +105,21 @@
}
}
- foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
- QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
- QObject *plugin = loader.instance();
- if (plugin) {
- if (KstDataSourcePluginInterface *ds = qobject_cast<KstDataSourcePluginInterface*>(plugin)) {
- tmpList.append(ds);
+ QStringList pluginPaths;
+ pluginPaths << QLibraryInfo::location(QLibraryInfo::PluginsPath);
+ pluginPaths << QString(qApp->applicationDirPath()).replace("bin", "plugin");
+
+ foreach (QString pluginPath, pluginPaths) {
+ QDir d(pluginPath);
+ foreach (QString fileName, d.entryList(QDir::Files)) {
+ QPluginLoader loader(d.absoluteFilePath(fileName));
+ QObject *plugin = loader.instance();
+ if (plugin) {
+ if (KstDataSourcePluginInterface *ds = qobject_cast<KstDataSourcePluginInterface*>(plugin)) {
+ tmpList.append(ds);
+ }
}
- }
+ }
}
// This cleans up plugins that have been uninstalled and adds in new ones.
--- branches/work/kst/portto4/kst/tests/main.cpp #717070:717071
@@ -21,5 +21,5 @@
QTest::qExec(&test1, argc, argv);
- return app.exec();
+ return 0;
}
--- branches/work/kst/portto4/kst/tests/testdatasources.cpp #717070:717071
@@ -31,9 +31,8 @@
void TestDataSources::testAscii() {
-
if (!_plugins.contains("ASCII File Reader"))
- QFAIL("Not running tests for ASCII File Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
{
QTemporaryFile tf;
@@ -260,9 +259,8 @@
void TestDataSources::testDirfile() {
-
if (!_plugins.contains("DirFile Reader"))
- QFAIL("Not running tests for DirFile Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
QWARN("These tests assume that the dirfile was generated with dirfile_maker");
@@ -410,35 +408,31 @@
void TestDataSources::testCDF() {
if (!_plugins.contains("CDF File Reader"))
- QFAIL("Not running tests for CDF File Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
}
void TestDataSources::testFrame() {
-
if (!_plugins.contains("Frame Reader"))
- QFAIL("Not running tests for Frame Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
}
void TestDataSources::testIndirect() {
-
if (!_plugins.contains("Indirect File Reader"))
- QFAIL("Not running tests for Indirect File Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
}
void TestDataSources::testLFI() {
-
if (!_plugins.contains("LFIIO Reader"))
- QFAIL("Not running tests for LFIIO Reader - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
}
void TestDataSources::testPlanck() {
-
if (!_plugins.contains("PLANCK Plugin"))
- QFAIL("Not running tests for x - couldn't find plugin.");
+ QFAIL("...couldn't find plugin.");
}
--- branches/work/kst/portto4/kst/tests/tests.pro #717070:717071
@@ -25,3 +25,5 @@
HEADERS += \
testdatasources.h
+
+QMAKE_RPATHDIR += $$OUTPUT_DIR/lib $$OUTPUT_DIR/plugin
More information about the Kst
mailing list