summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-06 17:09:27 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-06 17:09:27 (GMT)
commit7ee944a14582cd7202b4a8e94adc06e7ae5855a6 (patch)
tree0684ab4a4e02dc72c2e1f5bc72baaf55f0d0310f /tests/benchmarks
parentcd58bc13a4a37543d76a79b3cee7cd95bde0a14b (diff)
parent12d14efb2e1df3188c7c0001492f24fd193a11a9 (diff)
downloadQt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.zip
Qt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.tar.gz
Qt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.tar.bz2
Merge commit 'origin/4.6' into 4.6
Conflicts: dist/changes-4.6.0
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"