summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2009-11-06 14:30:20 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2009-11-06 14:30:20 (GMT)
commit89b6de9091adbf0645ffe2aba59cb17cb233c170 (patch)
tree1e3d5e5aea9a9061e3f86531820a7234d5fb1e90 /tests/benchmarks
parent4ad6343be52b757fd354cd92874bca944d2ede49 (diff)
downloadQt-89b6de9091adbf0645ffe2aba59cb17cb233c170.zip
Qt-89b6de9091adbf0645ffe2aba59cb17cb233c170.tar.gz
Qt-89b6de9091adbf0645ffe2aba59cb17cb233c170.tar.bz2
make the qapplication constructor test more meaningful
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qapplication/main.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/tests/benchmarks/qapplication/main.cpp b/tests/benchmarks/qapplication/main.cpp
index a299db2..0ec65a8 100644
--- a/tests/benchmarks/qapplication/main.cpp
+++ b/tests/benchmarks/qapplication/main.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
#include <QApplication>
-#include <QProcess>
#include <qtest.h>
@@ -54,34 +53,19 @@ private slots:
/*
Test the performance of the QApplication constructor.
- This test creates a new process and thus includes process creation overhead.
- Callgrind results are meaningless since the child process is not traced.
+ Note: results from the second start on can be misleading,
+ since all global statics are already initialized.
*/
void tst_qapplication::ctor()
{
- QProcess proc;
- const QString program = QCoreApplication::applicationFilePath();
- const QStringList arguments = QStringList() << QLatin1String("--exit-now");
-
+ // simulate reasonable argc, argv
+ int argc = 1;
+ char *argv[] = { "tst_qapplication" };
QBENCHMARK {
- proc.start(program, arguments);
- QVERIFY(proc.waitForStarted());
- QVERIFY(proc.waitForFinished());
- QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
- QCOMPARE(proc.exitCode(), 0);
+ QApplication app(argc, argv);
}
}
-int main(int argc, char** argv)
-{
- QApplication app(argc, argv);
-
- if (argc == 2 && QLatin1String("--exit-now") == QLatin1String(argv[1])) {
- return 0;
- }
-
- tst_qapplication test;
- return QTest::qExec(&test, argc, argv);
-}
+QTEST_APPLESS_MAIN(tst_qapplication)
#include "main.moc"