Skip to content

Commit 5c6abd3

Browse files
committed
[rtemodel] Fix license agreement path
1 parent 9d4bacc commit 5c6abd3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

libs/rtemodel/src/RteProject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ RteLicenseInfo* RteLicenseInfoCollection::EnsureLicenseInfo(RteItem* item, RteIt
145145
licFile = pack->GetChildText("license");
146146
}
147147
if (!licFile.empty()) {
148-
info->AddAttribute("agreement", "${CMSIS_PACK_ROOT}/" + pack->GetPackagePath(true) + licFile);
148+
info->AddAttribute("agreement", pack->GetAbsolutePackagePath() + licFile);
149149
}
150150
} else {
151151
info = it->second;

libs/rtemodel/test/src/RteModelTest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ TEST_F(RteModelPrjTest, LoadCprj) {
386386
loadedCprjProject->CollectLicenseInfos(licences);
387387
string licenseText = licences.ToString();
388388

389+
string packRoot = rteKernel.GetCmsisPackRoot();
390+
size_t index;
391+
while ((index = licenseText.find(packRoot)) != std::string::npos) {
392+
licenseText.replace(index, packRoot.length(), "${CMSIS_PACK_ROOT}");
393+
}
394+
389395
string licRefFile = prjsDir + RteTestM3 + "/license_info_ref.txt";
390396
EXPECT_TRUE(RteFsUtils::CmpFileMem(licRefFile, licenseText));
391397

0 commit comments

Comments
 (0)