forked from qt-creator/qt-creator
Fix execution of scenario
There are different ways of having a settingspath for QC. If the settingspath is not provided for starting QC we may use the global settings or a temporarily created settings folder. To correctly run the test scenario from inside a plugin unit test we need to have the same environment and settings. Change-Id: I5dcc61e162258a0af8d3c8df2e63255d0e35f464 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -310,7 +310,10 @@ void AutoTestUnitTests::testCodeParserBoostTest_data()
|
||||
void AutoTestUnitTests::testStringTable()
|
||||
{
|
||||
const PluginManager::ProcessData data = PluginManager::creatorProcessData();
|
||||
QCOMPARE(QProcess::execute(data.m_executable, data.m_args + QStringList({ "-scenario", "TestStringTable" })), 0);
|
||||
QStringList additionalArgs{ "-scenario", "TestStringTable" };
|
||||
if (!data.m_args.contains("-settingspath") && !data.m_settingsPath.isEmpty())
|
||||
additionalArgs << "-settingspath" << data.m_settingsPath;
|
||||
QCOMPARE(QProcess::execute(data.m_executable, data.m_args + additionalArgs), 0);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user