Skip to content

Commit 8b62d0a

Browse files
Improve error message in case of device not found
1 parent 200d967 commit 8b62d0a

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,7 @@ bool ProjMgrWorker::ProcessDevice(ContextItem& context, BoardOrDevice process) {
13121312
if (!matchedDevice) {
13131313
string msg = "specified device '" +
13141314
(deviceItem.vendor.empty() ? "" : deviceItem.vendor + "::") + deviceItem.name +
1315-
"' was not found among the installed packs.";
1316-
msg += "\nuse \'cpackget\' utility to install software packs.";
1315+
"' not found in the installed packs. Use:\n cpackget add Vendor::PackName";
13171316
ProjMgrLogger::Get().Error(msg, context.name);
13181317
return false;
13191318
}

tools/projmgr/test/data/TestSolution/PackMissing/ref/missing_pack.cbuild-idx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-idx:
1212
messages:
1313
errors:
1414
- "required pack: ARM::[email protected] not installed"
15-
- "specified device 'RteTest_ARMCM0' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
15+
- "specified device 'RteTest_ARMCM0' not found in the installed packs. Use:\n cpackget add Vendor::PackName"
1616
- processing context 'project+CM0' failed
1717
info:
1818
- missing_pack.cbuild-pack.yml - file skipped
@@ -26,7 +26,7 @@ build-idx:
2626
messages:
2727
errors:
2828
- "required pack: ARM::[email protected] not installed"
29-
- "specified device 'RteTest_ARMCM3' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
29+
- "specified device 'RteTest_ARMCM3' not found in the installed packs. Use:\n cpackget add Vendor::PackName"
3030
- processing context 'project+Gen' failed
3131
info:
3232
- missing_pack.cbuild-pack.yml - file skipped

tools/projmgr/test/data/TestSolution/PackMissing/ref/missing_pack_specific_context.cbuild-idx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-idx:
1212
messages:
1313
errors:
1414
- "required pack: ARM::[email protected] not installed"
15-
- "specified device 'RteTest_ARMCM0' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
15+
- "specified device 'RteTest_ARMCM0' not found in the installed packs. Use:\n cpackget add Vendor::PackName"
1616
- processing context 'project+CM0' failed
1717
info:
1818
- missing_pack.cbuild-pack.yml - file skipped

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,8 +2909,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unknown) {
29092909
// Test project with unknown device
29102910
char* argv[7];
29112911
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unknown.cproject.yml");
2912-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' was not found among the installed packs.
2913-
use 'cpackget' utility to install software packs.)";
2912+
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' not found in the installed packs. Use:
2913+
cpackget add Vendor::PackName)";
29142914
StdStreamRedirect streamRedirect;
29152915

29162916
argv[1] = (char*)"convert";
@@ -2928,8 +2928,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unknown_Vendor) {
29282928
// Test project with unknown device vendor
29292929
char* argv[7];
29302930
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unknown_vendor.cproject.yml");
2931-
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' was not found among the installed packs.
2932-
use 'cpackget' utility to install software packs.)";
2931+
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' not found in the installed packs. Use:
2932+
cpackget add Vendor::PackName)";
29332933
StdStreamRedirect streamRedirect;
29342934

29352935
argv[1] = (char*)"convert";
@@ -2965,8 +2965,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unavailable_In_Board) {
29652965
// Test project with device different from the board's mounted device
29662966
char* argv[7];
29672967
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unavailable_in_board.cproject.yml");
2968-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM7' was not found among the installed packs.
2969-
use 'cpackget' utility to install software packs.)";
2968+
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM7' not found in the installed packs. Use:
2969+
cpackget add Vendor::PackName)";
29702970
StdStreamRedirect streamRedirect;
29712971

29722972
argv[1] = (char*)"convert";
@@ -3032,8 +3032,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Correct_Board_Wrong_Device_Info) {
30323032
// Test project with correct board info but wrong device info
30333033
char* argv[7];
30343034
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_correct_board_wrong_device.cproject.yml");
3035-
const string& expectedErrStr = R"(error csolution: specified device 'ARM::RteTest_ARMCM_Unknown' was not found among the installed packs.
3036-
use 'cpackget' utility to install software packs.)";
3035+
const string& expectedErrStr = R"(error csolution: specified device 'ARM::RteTest_ARMCM_Unknown' not found in the installed packs. Use:
3036+
cpackget add Vendor::PackName)";
30373037
StdStreamRedirect streamRedirect;
30383038

30393039
argv[1] = (char*)"convert";

tools/projmgr/test/src/ProjMgrWorkerUnitTests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,8 @@ TEST_F(ProjMgrWorkerUnitTests, ProcessDevice_Invalid_Device_Name) {
695695
ProjMgrParser parser;
696696
ContextDesc descriptor;
697697
const string& filename = testinput_folder + "/TestSolution/TestProject4/test_device_unknown.cproject.yml";
698-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' was not found among the installed packs.
699-
use 'cpackget' utility to install software packs.)";
698+
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' not found in the installed packs. Use:
699+
cpackget add Vendor::PackName)";
700700
StdStreamRedirect streamRedirect;
701701

702702
EXPECT_TRUE(parser.ParseCproject(filename, true));
@@ -716,8 +716,8 @@ TEST_F(ProjMgrWorkerUnitTests, ProcessDevice_Invalid_Device_Vendor) {
716716
ContextDesc descriptor;
717717
const string& filename = testinput_folder +
718718
"/TestSolution/TestProject4/test_device_unknown_vendor.cproject.yml";
719-
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' was not found among the installed packs.
720-
use 'cpackget' utility to install software packs.)";
719+
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' not found in the installed packs. Use:
720+
cpackget add Vendor::PackName)";
721721
StdStreamRedirect streamRedirect;
722722

723723
EXPECT_TRUE(parser.ParseCproject(filename, true));

0 commit comments

Comments
 (0)