diff options
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 936b936..8c76c5d 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -54,6 +54,7 @@ #include <QtCore/qdir.h> #include <QtCore/qprocess.h> #include <QtCore/qdebug.h> +#include <QtCore/qlibraryinfo.h> #include "QtTest/private/qtestlog_p.h" #include "QtTest/private/qtesttable_p.h" @@ -846,9 +847,8 @@ static void qParseArgs(int argc, char *argv[]) " -iterations n : Sets the number of accumulation iterations.\n" " -median n : Sets the number of median iterations.\n" " -vb : Print out verbose benchmarking information.\n" -#ifndef QT_NO_PROCESS -// Will be enabled when tools are integrated. -// " -chart : Runs the chart generator after the test. No output is printed to the console\n" +#if !defined(QT_NO_PROCESS) || !defined(QT_NO_SETTINGS) + " -chart : Create chart based on the benchmark result.\n" #endif "\n" " -help : This help\n"; @@ -963,7 +963,7 @@ static void qParseArgs(int argc, char *argv[]) } else if (strcmp(argv[i], "-vb") == 0) { QBenchmarkGlobalData::current->verboseOutput = true; -#ifndef QT_NO_PROCESS +#if !defined(QT_NO_PROCESS) || !defined(QT_NO_SETTINGS) } else if (strcmp(argv[i], "-chart") == 0) { QBenchmarkGlobalData::current->createChart = true; QTestLog::setLogMode(QTestLog::XML); @@ -1463,26 +1463,17 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif -#ifndef QT_NO_PROCESS +#if !defined(QT_NO_PROCESS) || !defined(QT_NO_SETTINGS) if (QBenchmarkGlobalData::current->createChart) { - -#define XSTR(s) STR(s) -#define STR(s) #s -#ifdef Q_OS_WIN - const char * path = XSTR(QBENCHLIB_BASE) "/tools/generatereport/generatereport.exe"; -#else - const char * path = XSTR(QBENCHLIB_BASE) "/tools/generatereport/generatereport"; -#endif -#undef XSTR -#undef STR - - if (QFile::exists(QLatin1String(path))) { + QString chartLocation = QLibraryInfo::location(QLibraryInfo::BinariesPath) + + QLatin1String("/../tools/qtestlib/chart/chart"); + if (QFile::exists(chartLocation)) { QProcess p; p.setProcessChannelMode(QProcess::ForwardedChannels); - p.start(QLatin1String(path), QStringList() << QLatin1String("results.xml")); + p.start(chartLocation, QStringList() << QLatin1String("results.xml")); p.waitForFinished(-1); } else { - qWarning("Could not find %s, please make sure it is compiled.", path); + qDebug() << QLatin1String("Could not find the chart tool in ") + chartLocation + QLatin1String(", please make sure it is compiled."); } } #endif |