forked from qt-creator/qt-creator
Add TestStringTable scenario
This scenario is used for testing against regression in StringTable.
If the scenario went OK, the creator finishes and doesn't crash.
Later, this scenario will be invoked from additional test, so that
the second instance of creator will run and the test will
check if the subprocess finished OK. So it's going to be combined
with autotests in the follow up patch.
In order to test it, run creator with the following command line:
"-settingspath ~/.config -scenario TestStringTable". Make sure,
that you point settingspath to creator settings which have
proper kit with a toolchain and Qt setup.
The regression may be tested by restoring the
src/plugins/cpptools/stringtable.cpp to the parent of
f4ab1279fd and by applying on top of it
this patch (simple conflict may need to be resolved). In this case
running this scenario ends up with a crash (so, it confirms this test
fails on the old code form before the fix).
Change-Id: Icbb56233495047fd68bfb605fcd088f352a16323
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
#include <QThreadPool>
|
||||
#include <QTimer>
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#endif
|
||||
|
||||
using namespace CppTools::Internal;
|
||||
|
||||
enum {
|
||||
@@ -145,6 +149,13 @@ static inline bool isQStringInUse(const QString &string)
|
||||
|
||||
void StringTablePrivate::GC(QFutureInterface<void> &futureInterface)
|
||||
{
|
||||
#ifdef WITH_TESTS
|
||||
if (ExtensionSystem::PluginManager::isScenarioRunning("TestStringTable")) {
|
||||
if (ExtensionSystem::PluginManager::finishScenario())
|
||||
QThread::currentThread()->sleep(5);
|
||||
}
|
||||
#endif
|
||||
|
||||
int initialSize = 0;
|
||||
QElapsedTimer timer;
|
||||
if (DebugStringTable) {
|
||||
|
||||
Reference in New Issue
Block a user