@@ -15,15 +15,23 @@ using namespace types;
15
15
static const string INT64_MIN_STRING =
16
16
std::to_string (std::numeric_limits<int64_t >::min());
17
17
18
- const string Tests::DEFAULT_SCOPE_NAME = " regression" ;
19
- const string Tests::ERROR_SCOPE_NAME = " error" ;
18
+ const string Tests::DEFAULT_SUITE_NAME = " regression" ;
19
+ const string Tests::ERROR_SUITE_NAME = " error" ;
20
20
21
21
const Tests::MethodParam &tests::Tests::getStdinMethodParam () {
22
22
static const Tests::MethodParam stdinMethodParam =
23
23
MethodParam (types::Type::CStringType (), types::Type::getStdinParamName (), std::nullopt);
24
24
return stdinMethodParam;
25
25
}
26
26
27
+ Tests::MethodDescription::MethodDescription () : suiteTestCases{
28
+ {Tests::DEFAULT_SUITE_NAME, std::vector<MethodTestCase>()},
29
+ {Tests::ERROR_SUITE_NAME, std::vector<MethodTestCase>()}
30
+ }, codeText{
31
+ {Tests::DEFAULT_SUITE_NAME, std::string ()},
32
+ {Tests::ERROR_SUITE_NAME, std::string ()}
33
+ } {}
34
+
27
35
static string makeDecimalConstant (string value, const string &typeName) {
28
36
if (typeName == " long" ) {
29
37
if (value == INT64_MIN_STRING) {
@@ -516,13 +524,13 @@ void KTestObjectParser::parseKTest(const MethodKtests &batch,
516
524
}
517
525
}
518
526
519
- static string getScopeName (const UTBotKTest::Status &status,
527
+ static string getSuiteName (const UTBotKTest::Status &status,
520
528
const shared_ptr<LineInfo> lineInfo) {
521
529
bool forAssert = lineInfo != nullptr && lineInfo->forAssert ;
522
530
if (status == UTBotKTest::Status::FAILED || forAssert) {
523
- return Tests::ERROR_SCOPE_NAME ;
531
+ return Tests::ERROR_SUITE_NAME ;
524
532
}
525
- return Tests::DEFAULT_SCOPE_NAME ;
533
+ return Tests::DEFAULT_SUITE_NAME ;
526
534
}
527
535
528
536
int KTestObjectParser::findFieldIndex (const StructInfo &structInfo, unsigned int offset) {
@@ -671,8 +679,8 @@ void KTestObjectParser::parseTestCases(const UTBotKTestList &cases,
671
679
for (const auto &case_ : cases) {
672
680
std::stringstream traceStream;
673
681
traceStream << " Test case #" << (++caseCounter) << " :\n " ;
674
- string scopeName = getScopeName (case_.status , lineInfo);
675
- Tests::MethodTestCase testCase{ scopeName };
682
+ string suiteName = getSuiteName (case_.status , lineInfo);
683
+ Tests::MethodTestCase testCase{ suiteName };
676
684
vector<Tests::TestCaseParamValue> paramValues;
677
685
678
686
Tests::TestCaseDescription testCaseDescription;
@@ -734,6 +742,7 @@ void KTestObjectParser::parseTestCases(const UTBotKTestList &cases,
734
742
assignTypeStubVar (testCase, methodDescription);
735
743
736
744
methodDescription.testCases .push_back (testCase);
745
+ methodDescription.suiteTestCases [testCase.suiteName ].push_back (testCase);
737
746
}
738
747
}
739
748
@@ -1124,6 +1133,6 @@ bool isUnnamed(char *name) {
1124
1133
}
1125
1134
1126
1135
bool Tests::MethodTestCase::isError () const {
1127
- return scopeName == ERROR_SCOPE_NAME ;
1136
+ return suiteName == ERROR_SUITE_NAME ;
1128
1137
}
1129
1138
}
0 commit comments