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
1 change: 1 addition & 0 deletions tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ class ProjMgrWorker {
m_missingFiles.clear();
m_types = {};
m_activeTargetType.clear();
m_activeTargetSet = {};
m_missingToolchains.clear();
m_undefCompiler = false;
m_isSetupCommand = false;
Expand Down
7 changes: 7 additions & 0 deletions tools/projmgr/test/data/TestRpc/minimal2.cproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/cproject.schema.json

project:

components:
- component: Startup
- component: CORE
15 changes: 15 additions & 0 deletions tools/projmgr/test/data/TestRpc/minimal2.csolution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/csolution.schema.json

solution:

compiler: AC6

target-types:
- type: TestHW
device: RteTest_ARMCM4_NOFP

projects:
- project: minimal2.cproject.yml

packs:
- pack: ARM::RteTest_DFP
12 changes: 12 additions & 0 deletions tools/projmgr/test/src/ProjMgrRpcTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ TEST_F(ProjMgrRpcTests, RpcLoadUndefinedSolution) {
EXPECT_TRUE(msg.find("failed to load and process solution") == 0);
}

TEST_F(ProjMgrRpcTests, RpcLoadSolutionResetActiveTargetSet) {
auto csolutionPath = testinput_folder + "/TestRpc/minimal.csolution.yml";
auto csolutionPath2 = testinput_folder + "/TestRpc/minimal2.csolution.yml";
const auto requests =
FormatRequest(1, "LoadPacks") +
FormatRequest(2, "LoadSolution", json({{ "solution", csolutionPath }, { "activeTarget", "TestHW" }})) +
FormatRequest(3, "LoadSolution", json({{ "solution", csolutionPath2 }, { "activeTarget", "TestHW" }}));
const auto& responses = RunRpcMethods(requests);
// ensure loading 'minimal2' solution does fail due to m_activeTargetSet set when previously loading 'minimal'
EXPECT_TRUE(responses[2]["result"]["success"]);
}

TEST_F(ProjMgrRpcTests, RpcLoadNotSolution) {
const auto& requests = CreateLoadRequests("/TestRpc/undefined.yml");
const auto& responses = RunRpcMethods(requests);
Expand Down
Loading