Tests: Fix race condition when executing plugin tests

Usually the plugin tests are executed after the session manager
evaluated the command line arguments. This is just fine for the file and
token tests of the CppEditor (fileandtokenactions_test.cpp) since these
depend on the files and projects passed in via command line.

Running qtcreator within valgrind reverses the sequence and makes it
impossible to execute the mentioned tests. Fixed by starting the tests
after the plugin initialization is done.

Change-Id: I7cc392b7da7e0d98e0ce44edba2e3abceb84fad8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-07-24 11:17:31 +02:00
parent 1964241153
commit 871c9cfd3f
2 changed files with 4 additions and 6 deletions

View File

@@ -817,6 +817,10 @@ void PluginManagerPrivate::nextDelayedInitialize()
delayedInitializeTimer = 0;
profilingSummary();
emit q->initializationDone();
#ifdef WITH_TESTS
if (q->testRunRequested())
q->startTests();
#endif
} else {
delayedInitializeTimer->start();
}