Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/projmgr/src/ProjMgrRpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ RpcArgs::SuccessResult RpcHandler::LoadPacks(void) {
}

RpcArgs::SuccessResult RpcHandler::LoadSolution(const string& solution, const string& activeTarget) {
m_bUseAllPacks = false; // loading solution will first use only listed packs
m_packReferences.clear();
RpcArgs::SuccessResult result = {false};
const auto csolutionFile = RteFsUtils::MakePathCanonical(solution);
Expand Down Expand Up @@ -846,6 +847,9 @@ RpcArgs::ConvertSolutionResult RpcHandler::ConvertSolution(const string& solutio
if(!CheckSolutionArg(csolutionFile, result.message)) {
return result;
}
m_bUseAllPacks = false; // loading solution will first use only listed packs
m_packReferences.clear(); // will be updated

if(!m_manager.RunConvert(csolutionFile, activeTarget, updateRte) || !ProjMgrLogger::Get().GetErrors().empty()) {
if(m_worker.HasVarDefineError()) {
const auto& vars = m_worker.GetUndefLayerVars();
Expand Down
22 changes: 22 additions & 0 deletions tools/projmgr/test/src/ProjMgrRpcTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,28 @@ TEST_F(ProjMgrRpcTests, RpcResolveComponents) {
EXPECT_FALSE(responses[4]["result"].contains("validation"));
}

TEST_F(ProjMgrRpcTests, RpcGetComponentsTree) {
string context = "selectable+CM0";
vector<string> contextList = {
context
};
string csolution = "/Validation/dependencies.csolution.yml";
auto requests = CreateLoadRequests(csolution, "", contextList);
requests += FormatRequest(3, "GetComponentsTree", json({{ "context", context }, {"all", true}}));
requests += FormatRequest(4, "GetComponentsTree", json({{ "context", context }, {"all", false}}));
requests += FormatRequest(5, "LoadSolution", json({{ "solution", testinput_folder + csolution }, { "activeTarget", "" }}));
requests += FormatRequest(6, "GetComponentsTree", json({{ "context", context }, {"all", true}}));

const auto& responses = RunRpcMethods(requests);

auto size3 = responses[2]["result"]["classes"].size();
auto size4 = responses[3]["result"]["classes"].size();
auto size6 = responses[5]["result"]["classes"].size();
EXPECT_TRUE(size3 > size4); // there are more components in all packs that in packs listed in solution
EXPECT_EQ(size3, size6); // after solution reload, all components can be requested
}


TEST_F(ProjMgrRpcTests, RpcSelectComponent) {
string context = "selectable+CM0";
vector<string> contextList = {
Expand Down
Loading