Skip to content

Commit

Permalink
Adding a short description of the error to a test comment (#583)
Browse files Browse the repository at this point in the history
Adding a short description of the error to a test comment
  • Loading branch information
Nypiaka authored Feb 14, 2023
1 parent 76f9bdf commit 1bb82af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/src/Tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ namespace tests {
FileInfo getFileByName(char fileName) const {
return filesValues.value()[fileName - 'A'];
}

std::string getError() const {
if (!errorDescriptors.empty()) {
return errorDescriptors[0].substr(0, errorDescriptors[0].find('\n'));
}
return "";
}
};

struct Modifiers {
Expand Down
3 changes: 3 additions & 0 deletions server/src/printers/TestsPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ void TestsPrinter::genHeaders(Tests &tests, const fs::path& generatedHeaderPath)
}

void TestsPrinter::testHeader(const Tests::MethodTestCase &testCase) {
if (testCase.isError()) {
strComment(testCase.getError());
}
strFunctionCall("TEST", { testCase.suiteName, testCase.testName }, NL) << LB(false);
}

Expand Down
Empty file modified vscode-plugin/protoc.sh
100644 → 100755
Empty file.

0 comments on commit 1bb82af

Please sign in to comment.