Skip to content

Commit 1bb82af

Browse files
authored
Adding a short description of the error to a test comment (#583)
Adding a short description of the error to a test comment
1 parent 76f9bdf commit 1bb82af

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

server/src/Tests.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,13 @@ namespace tests {
467467
FileInfo getFileByName(char fileName) const {
468468
return filesValues.value()[fileName - 'A'];
469469
}
470+
471+
std::string getError() const {
472+
if (!errorDescriptors.empty()) {
473+
return errorDescriptors[0].substr(0, errorDescriptors[0].find('\n'));
474+
}
475+
return "";
476+
}
470477
};
471478

472479
struct Modifiers {

server/src/printers/TestsPrinter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ void TestsPrinter::genHeaders(Tests &tests, const fs::path& generatedHeaderPath)
408408
}
409409

410410
void TestsPrinter::testHeader(const Tests::MethodTestCase &testCase) {
411+
if (testCase.isError()) {
412+
strComment(testCase.getError());
413+
}
411414
strFunctionCall("TEST", { testCase.suiteName, testCase.testName }, NL) << LB(false);
412415
}
413416

vscode-plugin/protoc.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)