Skip to content

Commit 1e79219

Browse files
Improved error message, show Vendor name
1 parent 68b4327 commit 1e79219

File tree

5 files changed

+16
-20
lines changed

5 files changed

+16
-20
lines changed

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,10 @@ bool ProjMgrWorker::ProcessDevice(ContextItem& context) {
13271327
}
13281328
}
13291329
if (!matchedDevice) {
1330-
string msg = "specified device '" + deviceItem.name + "' was not found among the installed packs.";
1331-
msg += "\nuse \'cpackget\' utility to install software packs.\n cpackget add Vendor.PackName --pack-root ./Path/Packs";
1330+
string msg = "specified device '" +
1331+
(deviceItem.vendor.empty() ? "" : deviceItem.vendor + "::") + deviceItem.name +
1332+
"' was not found among the installed packs.";
1333+
msg += "\nuse \'cpackget\' utility to install software packs.";
13321334
ProjMgrLogger::Get().Error(msg, context.name);
13331335
return false;
13341336
}

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.\n cpackget add Vendor.PackName --pack-root ./Path/Packs"
15+
- "specified device 'RteTest_ARMCM0' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
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.\n cpackget add Vendor.PackName --pack-root ./Path/Packs"
29+
- "specified device 'RteTest_ARMCM3' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
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.\n cpackget add Vendor.PackName --pack-root ./Path/Packs"
15+
- "specified device 'RteTest_ARMCM0' was not found among the installed packs.\nuse 'cpackget' utility to install software packs."
1616
- processing context 'project+CM0' failed
1717
info:
1818
- missing_pack.cbuild-pack.yml - file skipped

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,8 +2896,7 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unknown) {
28962896
char* argv[7];
28972897
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unknown.cproject.yml");
28982898
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' was not found among the installed packs.
2899-
use 'cpackget' utility to install software packs.
2900-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
2899+
use 'cpackget' utility to install software packs.)";
29012900
StdStreamRedirect streamRedirect;
29022901

29032902
argv[1] = (char*)"convert";
@@ -2915,9 +2914,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unknown_Vendor) {
29152914
// Test project with unknown device vendor
29162915
char* argv[7];
29172916
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unknown_vendor.cproject.yml");
2918-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM0' was not found among the installed packs.
2919-
use 'cpackget' utility to install software packs.
2920-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
2917+
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' was not found among the installed packs.
2918+
use 'cpackget' utility to install software packs.)";
29212919
StdStreamRedirect streamRedirect;
29222920

29232921
argv[1] = (char*)"convert";
@@ -2954,8 +2952,7 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Device_Unavailable_In_Board) {
29542952
char* argv[7];
29552953
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_device_unavailable_in_board.cproject.yml");
29562954
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM7' was not found among the installed packs.
2957-
use 'cpackget' utility to install software packs.
2958-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
2955+
use 'cpackget' utility to install software packs.)";
29592956
StdStreamRedirect streamRedirect;
29602957

29612958
argv[1] = (char*)"convert";
@@ -3021,9 +3018,8 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Correct_Board_Wrong_Device_Info) {
30213018
// Test project with correct board info but wrong device info
30223019
char* argv[7];
30233020
string csolutionFile = UpdateTestSolutionFile("./TestProject4/test_correct_board_wrong_device.cproject.yml");
3024-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM_Unknown' was not found among the installed packs.
3025-
use 'cpackget' utility to install software packs.
3026-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
3021+
const string& expectedErrStr = R"(error csolution: specified device 'ARM::RteTest_ARMCM_Unknown' was not found among the installed packs.
3022+
use 'cpackget' utility to install software packs.)";
30273023
StdStreamRedirect streamRedirect;
30283024

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

tools/projmgr/test/src/ProjMgrWorkerUnitTests.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,7 @@ TEST_F(ProjMgrWorkerUnitTests, ProcessDevice_Invalid_Device_Name) {
675675
ContextDesc descriptor;
676676
const string& filename = testinput_folder + "/TestSolution/TestProject4/test_device_unknown.cproject.yml";
677677
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARM_UNKNOWN' was not found among the installed packs.
678-
use 'cpackget' utility to install software packs.
679-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
678+
use 'cpackget' utility to install software packs.)";
680679
StdStreamRedirect streamRedirect;
681680

682681
EXPECT_TRUE(parser.ParseCproject(filename, true));
@@ -696,9 +695,8 @@ TEST_F(ProjMgrWorkerUnitTests, ProcessDevice_Invalid_Device_Vendor) {
696695
ContextDesc descriptor;
697696
const string& filename = testinput_folder +
698697
"/TestSolution/TestProject4/test_device_unknown_vendor.cproject.yml";
699-
const string& expectedErrStr = R"(error csolution: specified device 'RteTest_ARMCM0' was not found among the installed packs.
700-
use 'cpackget' utility to install software packs.
701-
cpackget add Vendor.PackName --pack-root ./Path/Packs)";
698+
const string& expectedErrStr = R"(error csolution: specified device 'TEST::RteTest_ARMCM0' was not found among the installed packs.
699+
use 'cpackget' utility to install software packs.)";
702700
StdStreamRedirect streamRedirect;
703701

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

0 commit comments

Comments
 (0)