Skip to content

Commit f9d15ca

Browse files
grasci-armbrondani
andauthored
[projmgr] Fixes for RPC methods (#1352) (#2272)
Co-authored-by: Daniel Brondani <[email protected]>
1 parent 21f2570 commit f9d15ca

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,8 @@ class ProjMgrWorker {
11271127
m_missingFiles.clear();
11281128
m_types = {};
11291129
m_activeTargetType.clear();
1130+
m_undefCompiler = false;
1131+
m_isSetupCommand = false;
11301132
};
11311133

11321134
protected:

tools/projmgr/src/ProjMgrRpcServer.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ RpcArgs::ConvertSolutionResult RpcHandler::ConvertSolution(const string& solutio
714714
if (m_worker.HasVarDefineError()) {
715715
const auto& vars = m_worker.GetUndefLayerVars();
716716
result.undefinedLayers = StrVec(vars.begin(), vars.end());
717+
const auto& selectCompiler = m_worker.GetSelectableCompilers();
718+
if (!selectCompiler.empty()) {
719+
result.selectCompiler = selectCompiler;
720+
}
717721
result.message = "Layer variables undefined, names can be found under 'undefinedLayers'";
718722
} else if (m_worker.HasCompilerDefineError()) {
719723
result.selectCompiler = m_worker.GetSelectableCompilers();
@@ -769,6 +773,9 @@ RpcArgs::DiscoverLayersInfo RpcHandler::DiscoverLayers(const string& solution, c
769773
if (!variable.file.empty()) {
770774
lv.file = variable.file;
771775
}
776+
if (!variable.description.empty()) {
777+
lv.description = variable.description;
778+
}
772779
if (!variable.copyTo.empty()) {
773780
lv.copyTo = variable.copyTo;
774781
}

tools/projmgr/test/data/TestLayers/ref/rpc-discover-layers.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{
99
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config1.clayer.yml",
1010
"copy-to": "path/to/config1",
11+
"description": "Config1 Layer Description",
1112
"file": "config1.clayer.yml",
1213
"name": "Config1-Layer",
1314
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0/Layers",
@@ -23,6 +24,7 @@
2324
{
2425
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config2.clayer.yml",
2526
"copy-to": "path/to/config2",
27+
"description": "Config2 Layer Description",
2628
"file": "Layers/config2.clayer.yml",
2729
"name": "Config2-Layer",
2830
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0",
@@ -43,6 +45,7 @@
4345
{
4446
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config1.clayer.yml",
4547
"copy-to": "path/to/config1",
48+
"description": "Config1 Layer Description",
4649
"file": "config1.clayer.yml",
4750
"name": "Config1-Layer",
4851
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0/Layers",
@@ -58,6 +61,7 @@
5861
{
5962
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config3.clayer.yml",
6063
"copy-to": "path/to/config3",
64+
"description": "Config3 Layer Description",
6165
"file": "Layers/config3.clayer.yml",
6266
"name": "Config2-Layer",
6367
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0",
@@ -78,6 +82,7 @@
7882
{
7983
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config1.clayer.yml",
8084
"copy-to": "path/to/config1",
85+
"description": "Config1 Layer Description",
8186
"file": "config1.clayer.yml",
8287
"name": "Config1-Layer",
8388
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0/Layers",
@@ -93,6 +98,7 @@
9398
{
9499
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config2.clayer.yml",
95100
"copy-to": "path/to/config2",
101+
"description": "Config2 Layer Description",
96102
"file": "Layers/config2.clayer.yml",
97103
"name": "Config2-Layer",
98104
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0",
@@ -113,6 +119,7 @@
113119
{
114120
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config1.clayer.yml",
115121
"copy-to": "path/to/config1",
122+
"description": "Config1 Layer Description",
116123
"file": "config1.clayer.yml",
117124
"name": "Config1-Layer",
118125
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0/Layers",
@@ -128,6 +135,7 @@
128135
{
129136
"clayer": "${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Layers/config3.clayer.yml",
130137
"copy-to": "path/to/config3",
138+
"description": "Config3 Layer Description",
131139
"file": "Layers/config3.clayer.yml",
132140
"name": "Config2-Layer",
133141
"path": "${DEVTOOLS(packs)}/ARM/RteTest_DFP/0.2.0",

tools/projmgr/test/src/ProjMgrRpcTests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ TEST_F(ProjMgrRpcTests, RpcDiscoverLayers) {
813813
auto responses = RunRpcMethods(requests);
814814

815815
// valid configurations: compare response with golden reference
816-
EXPECT_TRUE(CompareRpcResponse(responses[0], testinput_folder + "/TestLayers/ref/rpc-discover-layers.json"));
816+
EXPECT_TRUE(CompareRpcResponse(responses[0], testinput_folder + "/TestLayers/ref/rpc-discover-layers.json"))
817+
<< "json response:\n" << ProjMgrTestEnv::StripAbsoluteFunc(responses[0].dump(2));
817818

818819
// unknown active target set
819820
csolutionPath = testinput_folder + "/TestLayers/config.csolution.yml";

0 commit comments

Comments
 (0)