Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2268,8 +2268,14 @@ bool ProjMgrWorker::CheckConfigPLMFiles(ContextItem& context) {
// get absolute path to file instance
const string file = fs::path(context.cproject->directory).append(fi.second->GetInstanceName()).generic_string();
if (!RteFsUtils::Exists(file)) {
error = true;
ProjMgrLogger::Get().Error("file '" + file + "' not found; use --update-rte", context.name);
const auto& msg = "file '" + file + "' not found; use --update-rte";
if (fi.second->HasAttribute("configfile")) {
// missing dbgconf file is just a warning
ProjMgrLogger::Get().Warn(msg, context.name);
} else {
ProjMgrLogger::Get().Error(msg, context.name);
error = true;
}
context.plmStatus[file] = PLM_STATUS_MISSING_FILE;
continue;
}
Expand Down
22 changes: 22 additions & 0 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6805,6 +6805,28 @@ TEST_F(ProjMgrUnitTests, TestNoDbgconf) {
EXPECT_FALSE(cbuildrun["cbuild-run"]["debugger"]["dbgconf"].IsDefined());
}

TEST_F(ProjMgrUnitTests, MissingDbgconf) {
const string csolutionFile = testinput_folder + "/TestSolution/test.csolution.yml";
const string dbgconf = testinput_folder + "/TestSolution/.cmsis/test+CM0.dbgconf";
char* argv[6];
argv[1] = (char*)"convert";
argv[2] = (char*)csolutionFile.c_str();
argv[3] = (char*)"-a";
argv[4] = (char*)"CM0";
EXPECT_EQ(0, RunProjMgr(5, argv, m_envp));

// remove dbgconf file and convert again but with --no-update-rte
// the missing dbgconf is just a warning, the convert must succeed
StdStreamRedirect streamRedirect;
EXPECT_TRUE(RteFsUtils::RemoveFile(dbgconf));
EXPECT_FALSE(RteFsUtils::Exists(dbgconf));
argv[5] = (char*)"--no-update-rte";
EXPECT_EQ(0, RunProjMgr(6, argv, m_envp));
auto errStr = streamRedirect.GetErrorString();
auto expected = "warning csolution: file '" + dbgconf + "' not found; use --update-rte";
EXPECT_TRUE(errStr.find(expected) != string::npos);
}

TEST_F(ProjMgrUnitTests, TestRunDebugMulticore) {
char* argv[7];
const string& csolution = testinput_folder + "/TestRunDebug/run-debug.csolution.yml";
Expand Down
Loading