forked from Open-CMSIS-Pack/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRteChkTest.cpp
More file actions
61 lines (52 loc) · 1.2 KB
/
Copy pathRteChkTest.cpp
File metadata and controls
61 lines (52 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2020-2023 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "gtest/gtest.h"
#include "RteModelTestConfig.h"
#include "RteChk.h"
#include "RteFsUtils.h"
using namespace std;
TEST(RteChkTest, Summary) {
const string summary = "Collecting pdsc files 9 files found\n\
Parsing XML passed\n\
\n\
Constructing Model passed\n\
\n\
Cleaning XML data\n\
\n\
Validating Model passed\n\
\n\
Summary:\n\
Packs: 9\n\
Generic: 4\n\
DFP: 3\n\
BSP: 2\n\
\n\
Components: 61\n\
From generic packs: 36\n\
From DFP: 25\n\
From BSP: 0\n\
\n\
Devices: 10\n\
Boards: 15\n\
\n\
completed\n";
list<string> files;
RteFsUtils::GetPackageDescriptionFiles(files, RteModelTestConfig::CMSIS_PACK_ROOT, 3);
EXPECT_TRUE(files.size() > 0);
stringstream ss;
RteChk rteChk(ss);
rteChk.SetFlag(RteChk::TIME, '-');
rteChk.AddFileDir(RteModelTestConfig::CMSIS_PACK_ROOT);
int res = rteChk.RunCheckRte();
EXPECT_EQ(res, 0);
EXPECT_EQ(rteChk.GetPackCount(), 9);
EXPECT_EQ(rteChk.GetComponentCount(), 61);
EXPECT_EQ(rteChk.GetDeviceCount(), 10);
EXPECT_EQ(rteChk.GetBoardCount(), 15);
string s = RteUtils::EnsureLf(ss.str());
EXPECT_EQ(s, summary);
}
// end of RteChkTest.cpp