McuSupport: support reading packages defaultValues depending on OS

default values can vary between windows and linux so when it is the
case a json object can be specified to describe the default values for
both.

Change-Id: Ifd3e4225ba0e1b1760f93ecea9cfafa4545c3404
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Yasser Grimes
2022-09-23 15:38:56 +03:00
parent b7ac02ab90
commit e38efabea9
3 changed files with 24 additions and 1 deletions

View File

@@ -1444,4 +1444,14 @@ void McuSupportTest::test_legacy_createThirdPartyPackage()
QVERIFY(qunsetenv(envVar.toLocal8Bit()));
}
void McuSupportTest::test_defaultValueForEachOperationSystem()
{
const auto packageDescription = parseDescriptionJson(armgcc_mimxrt1050_evk_freertos_json);
auto default_path_entry = packageDescription.platform.entries[0].defaultPath.toString();
if (HostOsInfo::isWindowsHost())
QCOMPARE(QString("%{Env:ROOT}/nxp/MCUXpressoIDE*"), default_path_entry);
else
QCOMPARE(QString("/usr/local/mcuxpressoide"), default_path_entry);
};
} // namespace McuSupport::Internal::Test