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: 2 additions & 2 deletions tools/projmgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ include(FetchContent)
FetchContent_Declare(
rpc-interface
DOWNLOAD_EXTRACT_TIMESTAMP ON
URL https://github.com/Open-CMSIS-Pack/csolution-rpc/releases/download/v0.0.8/csolution-rpc.zip
URL_HASH SHA256=e347a98b6130c64d942d360ad31ca49899f3bf3113d40d9c460d6cd8f4c07b11
URL https://github.com/Open-CMSIS-Pack/csolution-rpc/releases/download/v0.0.9/csolution-rpc.zip
URL_HASH SHA256=2be58020a28b7f8cda5da8f6cba8f605f93346beb32805919c5872b8fbc0d541
)
FetchContent_MakeAvailable(rpc-interface)

Expand Down
3 changes: 3 additions & 0 deletions tools/projmgr/src/ProjMgrRpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ PackReferenceVector RpcHandler::CollectPackReferences(const string& context) {
packRef.origin = packItem.origin;
packRef.path = packItem.path;
packRef.selected = true; // initially pack is selected;
if (!contextItem.availablePackVersions[packId].empty()) {
packRef.upgrade = contextItem.availablePackVersions[packId];
}
packRefs.push_back(packRef);
}
return packRefs;
Expand Down
15 changes: 15 additions & 0 deletions tools/projmgr/test/src/ProjMgrRpcTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,21 @@ TEST_F(ProjMgrRpcTests, RpcGetUsedItems) {
EXPECT_TRUE(components[1]["options"]["explicitVendor"]);
}

TEST_F(ProjMgrRpcTests, RpcGetUsedItemsLocked) {
string context = "project_with_dfp_components+CM0";
vector<string> contextList = {
context
};
auto requests = CreateLoadRequests("/TestSolution/PackLocking/lock_pack_version.csolution.yml", "", contextList);
requests += FormatRequest(3, "GetUsedItems", json({ { "context", context } }));
const auto& responses = RunRpcMethods(requests);
EXPECT_TRUE(responses[2]["result"]["success"]);
auto packs = responses[2]["result"]["packs"];
EXPECT_EQ(packs[0]["pack"], "ARM::RteTest_DFP");
EXPECT_EQ(packs[0]["resolvedPack"], "ARM::RteTest_DFP@0.1.1");
EXPECT_EQ(packs[0]["upgrade"], "0.2.0");
}

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