Skip to content

Commit b20824e

Browse files
authored
[projmgr] Decrease message's severity for constructed files recreation
1 parent e711fc9 commit b20824e

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

libs/rtemodel/src/RteTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ bool RteTarget::GenerateRteHeaderFile(const string& headerName, const string& co
20632063
// file does not exist or its content is different
20642064
if (RteFsUtils::CopyBufferToFile(headerFile, oss.str(), false) // write file
20652065
&& !GetProject()->ShouldUpdateRte() && !bRegionsHeader) {
2066-
callback->OutputMessage("Constructed file " + headerFile + " was recreated");
2066+
callback->OutputInfoMessage("Constructed file " + headerFile + " was recreated");
20672067
}
20682068
return true;
20692069
}

tools/projmgr/include/ProjMgrCallback.h

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 Arm Limited. All rights reserved.
2+
* Copyright (c) 2020-2025 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -33,13 +33,21 @@ class ProjMgrCallback : public RteCallback {
3333
}
3434

3535
/**
36-
* @brief obtain warning messages
37-
* @return list of all warning messages
38-
*/
36+
* @brief obtain warning messages
37+
* @return list of all warning messages
38+
*/
3939
const std::list<std::string>& GetWarningMessages() const {
4040
return m_warningMessages;
4141
}
4242

43+
/**
44+
* @brief obtain info messages
45+
* @return list of all info messages
46+
*/
47+
const std::list<std::string>& GetInfoMessages() const {
48+
return m_infoMessages;
49+
}
50+
4351
/**
4452
* @brief clear all error messages
4553
*/
@@ -54,6 +62,13 @@ class ProjMgrCallback : public RteCallback {
5462
m_warningMessages.clear();
5563
}
5664

65+
/**
66+
* @brief clear all info messages
67+
*/
68+
void ClearInfoMessages() {
69+
m_infoMessages.clear();
70+
}
71+
5772
/**
5873
* @brief clear all output messages
5974
*/
@@ -71,6 +86,12 @@ class ProjMgrCallback : public RteCallback {
7186
*/
7287
void OutputMessage(const std::string& message) override;
7388

89+
/**
90+
* @brief output specified info message
91+
* @param message string to output specified info message
92+
*/
93+
void OutputInfoMessage(const std::string& message) override;
94+
7495
/**
7596
* @brief create error message string and add it to message list
7697
* @param id error Id
@@ -82,6 +103,7 @@ class ProjMgrCallback : public RteCallback {
82103
protected:
83104
std::list<std::string> m_errorMessages;
84105
std::list<std::string> m_warningMessages;
106+
std::list<std::string> m_infoMessages;
85107

86108
};
87109
#endif // PROJMGRCALLBACK_H

tools/projmgr/src/ProjMgrCallback.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 Arm Limited. All rights reserved.
2+
* Copyright (c) 2020-2025 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -49,4 +49,11 @@ void ProjMgrCallback::OutputMessage(const string& message)
4949
}
5050
}
5151

52+
void ProjMgrCallback::OutputInfoMessage(const string& message)
53+
{
54+
if (!message.empty()) {
55+
m_infoMessages.push_back(message);
56+
}
57+
}
58+
5259
// end of ProjMgrCallback.cpp

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,15 @@ std::vector<PackageItem> ProjMgrWorker::GetFilteredPacks(const PackageItem& pack
610610

611611
bool ProjMgrWorker::CheckRteErrors(void) {
612612
const auto& callback = m_kernel->GetCallback();
613+
const list<string>& rteInfoMessages = callback->GetInfoMessages();
614+
if (!rteInfoMessages.empty()) {
615+
string infoMsg = "RTE Model reports:";
616+
for (const auto& rteInfoMessage : rteInfoMessages) {
617+
infoMsg += "\n" + rteInfoMessage;
618+
}
619+
ProjMgrLogger::Get().Info(infoMsg);
620+
callback->ClearInfoMessages();
621+
}
613622
const list<string>& rteWarningMessages = callback->GetWarningMessages();
614623
if (!rteWarningMessages.empty()) {
615624
string warnMsg = "RTE Model reports:";

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3883,7 +3883,7 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_NoUpdateRTEFiles) {
38833883
argv[7] = (char*)"--cbuildgen";
38843884
EXPECT_EQ(1, RunProjMgr(8, argv, m_envp));
38853885

3886-
EXPECT_NE(streamRedirect.GetErrorString().find("RTE/_TEST_TARGET/RTE_Components.h was recreated"), string::npos);
3886+
EXPECT_NE(streamRedirect.GetOutString().find("RTE/_TEST_TARGET/RTE_Components.h was recreated"), string::npos);
38873887

38883888
// Only constructed files are created in the RTE folder
38893889
GetFilesInTree(rteFolder, rteFiles);

0 commit comments

Comments
 (0)