Skip to content

Commit

Permalink
[projmgr] error msg on list layers
Browse files Browse the repository at this point in the history
  • Loading branch information
grasci-arm authored Jul 16, 2024
1 parent cf70ed3 commit f161ad8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tools/projmgr/src/ProjMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,10 @@ bool ProjMgr::RunListLayers(void) {
// Step3: Detect layers and list them
vector<string> layers;
error = !m_worker.ListLayers(layers, m_clayerSearchPath, m_failedContext);
if (error) {
ProjMgrLogger::Error("error occurred during layer detection. Please review the project and its dependencies");
}

// If the worker has toolchain errors, set the error flag
if (m_worker.HasToolchainErrors()) {
error = true;
Expand Down
8 changes: 6 additions & 2 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,8 @@ connections are invalid\n\
\n\
no valid combination of clayers was found\n\
\n\
error csolution: error occurred during layer detection. Please review the project and its dependencies\
\n\
";

const string& errStr = streamRedirect.GetErrorString();
Expand Down Expand Up @@ -2121,7 +2123,8 @@ check combined connections:\
EXPECT_EQ(1, RunProjMgr(8, argv, m_envp));

errStr = streamRedirect.GetErrorString();
EXPECT_TRUE(regex_match(errStr, regex(".*invalid/clayer/path - error csolution: clayer search path does not exist\n")));
string expectedStr = ".*invalid/clayer/path - error csolution: clayer search path does not exist\nerror csolution: error occurred during layer detection. Please review the project and its dependencies\n";
EXPECT_TRUE(regex_match(errStr, regex(expectedStr)));
}

TEST_F(ProjMgrUnitTests, LayerVariables) {
Expand Down Expand Up @@ -2198,7 +2201,8 @@ no valid combination of clayers was found.*\
streamRedirect.ClearStringStreams();
expectedErrStr = ".*\
error csolution: undefined variables in variables-notdefined.csolution.yml:.*\
- \\$NotDefined\\$";
- \\$NotDefined\\$\
error csolution: error occurred during layer detection. Please review the project and its dependencies";

argv[7] = (char*)"-q";
EXPECT_EQ(1, RunProjMgr(8, argv, m_envp));
Expand Down

0 comments on commit f161ad8

Please sign in to comment.