Skip to content

Commit 2e4575c

Browse files
authored
[projmgr] PLM status: consider config file's pre-release qualifier (#1993)
1 parent 7583317 commit 2e4575c

File tree

9 files changed

+128
-6
lines changed

9 files changed

+128
-6
lines changed

libs/rtemodel/test/src/RteChkTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Generic: 4\n\
3030
DFP: 3\n\
3131
BSP: 1\n\
3232
\n\
33-
Components: 58\n\
34-
From generic packs: 35\n\
33+
Components: 59\n\
34+
From generic packs: 36\n\
3535
From DFP: 23\n\
3636
From BSP: 0\n\
3737
\n\
@@ -51,7 +51,7 @@ completed\n";
5151
int res = rteChk.RunCheckRte();
5252
EXPECT_EQ(res, 0);
5353
EXPECT_EQ(rteChk.GetPackCount(), 8);
54-
EXPECT_EQ(rteChk.GetComponentCount(), 58);
54+
EXPECT_EQ(rteChk.GetComponentCount(), 59);
5555
EXPECT_EQ(rteChk.GetDeviceCount(), 10);
5656
EXPECT_EQ(rteChk.GetBoardCount(), 14);
5757

test/packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@
390390
<file category="header" attr="template" name="Template/template.h" select="dummy template file"/>
391391
</files>
392392
</component>
393+
394+
<component Cclass="RteTest" Cgroup="TestVersion" Cversion="1.8-dev1">
395+
<description>Component version without patch number and with pre-release suffix</description>
396+
<files>
397+
<file category="header" name="Include/Config/ConfigInclude.h" attr="config"/>
398+
</files>
399+
</component>
393400
</components>
394401

395402
<examples>

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ bool ProjMgrWorker::CheckConfigPLMFiles(ContextItem& context) {
21382138
const string updateVersion = f ? f->GetSemVer(true) : "";
21392139
if (baseVersion != updateVersion) {
21402140
// parse and check each semantic version segment
2141-
static const regex regEx = regex("(\\d+).(\\d+).(\\d+)");
2141+
static const regex regEx = regex("(\\d+).(\\d+).(\\d+(?:-.*)*)");
21422142
smatch base, update;
21432143
regex_match(baseVersion, base, regEx);
21442144
regex_match(updateVersion, update, regEx);
@@ -4927,10 +4927,10 @@ bool ProjMgrWorker::ListConfigFiles(vector<string>& configFiles) {
49274927
const string absFile = fs::path(context.cproject->directory).append(fi.second->GetInstanceName()).generic_string();
49284928
configEntry += "\n - " + absFile;
49294929
// get base version
4930-
const string baseVersion = fi.second->GetSemVer();
4930+
const string baseVersion = fi.second->GetSemVer(true);
49314931
configEntry += " (base@" + baseVersion + ")";
49324932
// get update version
4933-
const string updateVersion = fi.second->GetFile(context.rteActiveTarget->GetName())->GetSemVer();
4933+
const string updateVersion = fi.second->GetFile(context.rteActiveTarget->GetName())->GetSemVer(true);
49344934
if (updateVersion != baseVersion) {
49354935
configEntry += " (update@" + updateVersion + ")";
49364936
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Dummy
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Dummy
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
build:
2+
generated-by: csolution version 2.8.0
3+
solution: ../data/TestSolution/ComponentSources/versions.csolution.yml
4+
project: ../data/TestSolution/ComponentSources/versions.cproject.yml
5+
context: versions.Debug+RteTest_ARMCM3
6+
compiler: AC6
7+
device: ARM::RteTest_ARMCM3
8+
device-pack: ARM::[email protected]
9+
device-books:
10+
- name: http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/index.html
11+
title: Cortex-M3 Device Generic Users Guide
12+
dbgconf:
13+
- file: ../data/TestSolution/ComponentSources/RTE/Device/RteTest_ARMCM3/ARMCM.dbgconf
14+
version: 0.0.2
15+
processor:
16+
fpu: off
17+
core: Cortex-M3
18+
packs:
19+
- pack: ARM::[email protected]
20+
path: ${CMSIS_PACK_ROOT}/ARM/RteTest/0.1.0
21+
- pack: ARM::[email protected]
22+
path: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0
23+
define:
24+
- ARMCM3
25+
- _RTE_
26+
define-asm:
27+
- ARMCM3
28+
- _RTE_
29+
add-path:
30+
- ../data/TestSolution/ComponentSources/RTE/RteTest
31+
- ../data/TestSolution/ComponentSources/RTE/_Debug_RteTest_ARMCM3
32+
- ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Device/ARM/ARMCM3/Include
33+
add-path-asm:
34+
- ../data/TestSolution/ComponentSources/RTE/RteTest
35+
- ../data/TestSolution/ComponentSources/RTE/_Debug_RteTest_ARMCM3
36+
- ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Device/ARM/ARMCM3/Include
37+
output-dirs:
38+
intdir: tmp
39+
outdir: out/versions/RteTest_ARMCM3/Debug
40+
rtedir: ../data/TestSolution/ComponentSources/RTE
41+
output:
42+
- type: elf
43+
file: versions.axf
44+
components:
45+
- component: ARM::RteTest:[email protected]
46+
from-pack: ARM::[email protected]
47+
selected-by: RteTest:TestVersion
48+
files:
49+
- file: ../data/TestSolution/ComponentSources/RTE/RteTest/ConfigInclude.h
50+
category: header
51+
attr: config
52+
version: 1.8.0-dev1
53+
base: ../data/TestSolution/ComponentSources/RTE/RteTest/[email protected]
54+
update: ../data/TestSolution/ComponentSources/RTE/RteTest/[email protected]
55+
status: update suggested
56+
linker:
57+
script: ../data/TestSolution/ComponentSources/RTE/Device/RteTest_ARMCM3/ac6_linker_script.sct.src
58+
regions: ../data/TestSolution/ComponentSources/RTE/Device/RteTest_ARMCM3/regions_RteTest_ARMCM3.h
59+
constructed-files:
60+
- file: ../data/TestSolution/ComponentSources/RTE/_Debug_RteTest_ARMCM3/RTE_Components.h
61+
category: header
62+
licenses:
63+
- license: <unknown>
64+
license-agreement: ${CMSIS_PACK_ROOT}/ARM/RteTest_DFP/0.2.0/Doc/license.txt
65+
packs:
66+
- pack: ARM::[email protected]
67+
- license: BSD-3-Clause
68+
packs:
69+
- pack: ARM::[email protected]
70+
components:
71+
- component: ARM::RteTest:[email protected]
72+
- license: MIT
73+
packs:
74+
- pack: ARM::[email protected]
75+
components:
76+
- component: ARM::RteTest:[email protected]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/cproject.schema.json
2+
3+
project:
4+
components:
5+
- component: RteTest:TestVersion
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# yaml-language-server: $schema=D:\work\devtools-wip\tools\projmgr\schemas\csolution.schema.json
2+
3+
solution:
4+
5+
compiler: AC6
6+
7+
build-types:
8+
- type: Debug
9+
10+
target-types:
11+
- type: RteTest_ARMCM3
12+
device: RteTest_ARMCM3
13+
14+
projects:
15+
- project: versions.cproject.yml
16+
17+
packs:
18+
- pack: ARM::RteTest
19+
- pack: ARM::RteTest_DFP

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6715,3 +6715,16 @@ error csolution: invalid define: \\\"Mixed_quotes\", improper quotes\n\
67156715
errStr = streamRedirect.GetErrorString();
67166716
EXPECT_EQ(errStr, expected);
67176717
}
6718+
6719+
TEST_F(ProjMgrUnitTests, ComponentVersions) {
6720+
char* argv[5];
6721+
const string& csolution = testinput_folder + "/TestSolution/ComponentSources/versions.csolution.yml";
6722+
argv[1] = (char*)"convert";
6723+
argv[2] = (char*)csolution.c_str();
6724+
argv[3] = (char*)"-o";
6725+
argv[4] = (char*)testoutput_folder.c_str();
6726+
EXPECT_EQ(0, RunProjMgr(5, argv, m_envp));
6727+
6728+
ProjMgrTestEnv::CompareFile(testoutput_folder + "/versions.Debug+RteTest_ARMCM3.cbuild.yml",
6729+
testinput_folder + "/TestSolution/ComponentSources/ref/versions.Debug+RteTest_ARMCM3.cbuild.yml");
6730+
}

0 commit comments

Comments
 (0)