diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-11-21 15:09:08 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-11-22 06:50:42 +0000 |
commit | 818f2d0c5cf19e2a036e858ea1d9339750ef0296 (patch) | |
tree | 0e84b6593aed0ecc9f618d799134dd0a07aece28 /src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp | |
parent | e53e0a808b5d0075c95fd7635ce53cc4de277f3a (diff) | |
download | qt-creator-818f2d0c5cf19e2a036e858ea1d9339750ef0296.tar.gz |
CppTools: Fix race condition when opening projects for tests
The ClangTools plugin tests open a project and immediately trigger a
build afterwards. We checked whether CppModelManager got already data
from the project manager, but this alone was racy for the mentioned use
case as e.g. the QbsProjectManager might still be in parsing mode and
thus the build was not triggerable. Check for the parsing state, too.
While at it, simplify the code by using QTest::qWaitFor(), which also
takes care of posted events.
Change-Id: Id298695b2e67578def42275bac4ea31f4a39edf2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp b/src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp index 25d22bb1c1..8556c84b4b 100644 --- a/src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp +++ b/src/plugins/clangcodemodel/test/clangbatchfileprocessor.cpp @@ -237,7 +237,7 @@ bool OpenProjectCommand::run() Project *project = openProjectSucceeded.project(); project->configureAsExampleProject(); - return CppTools::Tests::TestCase::waitUntilCppModelManagerIsAwareOf(project, timeOutInMs()); + return CppTools::Tests::TestCase::waitUntilProjectIsFullyOpened(project, timeOutInMs()); } Command::Ptr OpenProjectCommand::parse(BatchFileLineTokenizer &arguments, |