QtTest: Don't crash when -callgrind is used on QTEST_APPLESS_MAIN
authorThiago Macieira <thiago.macieira@intel.com>
Sat, 22 Feb 2014 03:02:45 +0000 (19:02 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 24 Feb 2014 10:52:27 +0000 (11:52 +0100)
commite85b4ed77a6b77e4a5aa9b858e41ff4bbcea04b0
treefe21f2ece7a8703406626bcfcbc3f2f07536c405
parent12a7d23d528262ec1eca3c870fc19ef7d54ca417
QtTest: Don't crash when -callgrind is used on QTEST_APPLESS_MAIN

If there's no qApp, then QCoreApplication::arguments() returns an empty
list (after printing a warning). That means the callgrind runner can't
get the arguments it needs in order to rerun the benchmark.

The crash happens because it always uses .at(0) to try and get the
executable's path. Even if we get the path from somewhere else, we still
need the arguments.

Change-Id: I5c74af4d96fc5824b2b7fd7a89648d78393016e2
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
src/testlib/qtestcase.cpp