Make generatorstest work without installing first

frameworks
Alex Richardson 11 years ago
parent bb22f7d3f1
commit 437b2d4a3a
  1. 5
      autotests/generatorstest.cpp

@ -25,6 +25,7 @@ private slots:
void GeneratorsTest::testLoadsCorrectly() void GeneratorsTest::testLoadsCorrectly()
{ {
QCoreApplication::setLibraryPaths(QStringList());
QVERIFY2(QDir(GENERATORS_BUILD_DIR).exists(), GENERATORS_BUILD_DIR); QVERIFY2(QDir(GENERATORS_BUILD_DIR).exists(), GENERATORS_BUILD_DIR);
// find all possible generators in $CMAKE_BINARY_DIR/generators // find all possible generators in $CMAKE_BINARY_DIR/generators
// We can't simply hardcore the list of generators since some might not be built // We can't simply hardcore the list of generators since some might not be built
@ -37,14 +38,14 @@ void GeneratorsTest::testLoadsCorrectly()
if (it.fileName().startsWith(QLatin1String("kio_"))) { if (it.fileName().startsWith(QLatin1String("kio_"))) {
continue; // don't check kio_msits.so continue; // don't check kio_msits.so
} }
generatorLibs << it.fileName(); generatorLibs << it.fileInfo().absoluteFilePath();
} }
} }
int failures = 0; int failures = 0;
int successful = 0; int successful = 0;
foreach (const QString& lib, generatorLibs) { foreach (const QString& lib, generatorLibs) {
KPluginLoader loader(lib); KPluginLoader loader(lib);
QVERIFY(!loader.fileName().isEmpty()); QVERIFY2(!loader.fileName().isEmpty(), qPrintable(lib));
auto factory = loader.factory(); auto factory = loader.factory();
if (!factory) { if (!factory) {
qWarning() << "Could not get KPluginFactory for" << lib; qWarning() << "Could not get KPluginFactory for" << lib;

Loading…
Cancel
Save