Skip to content

Commit

Permalink
Fix error reporting in chip-tool. (#17760)
Browse files Browse the repository at this point in the history
The actual error message got lost in #17628.
  • Loading branch information
bzbarsky-apple authored Apr 27, 2022
1 parent 7666b04 commit afe0fef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/tests/TestCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void TestCommand::Exit(std::string message, CHIP_ERROR err)
{
mContinueProcessing = false;

LogEnd(err);
LogEnd(message, err);

if (CHIP_NO_ERROR == err)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/placeholder/linux/include/TestCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TestCommand : public TestRunner,

void Exit(std::string message, CHIP_ERROR err) override
{
LogEnd(err);
LogEnd(message, err);
SetCommandExitStatus(err);
}

Expand Down
7 changes: 3 additions & 4 deletions src/app/tests/suites/include/TestRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class TestRunner
ChipLogProgress(chipTool, " ***** Test Step %u : %s\n", stepNumber, stepName);
}

void LogEnd(CHIP_ERROR err)
void LogEnd(std::string message, CHIP_ERROR err)
{
if (CHIP_NO_ERROR == err)
{
ChipLogProgress(chipTool, " **** Test Complete: %s\n", mTestName);
ChipLogProgress(chipTool, " **** Test Complete: %s\n", message.c_str());
}
else
{
ChipLogError(chipTool, " ***** Test Failure: %s\n", mTestName);
ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str());
}
}

Expand All @@ -59,7 +59,6 @@ class TestRunner

if (mTestCount == mTestIndex)
{
LogEnd(CHIP_NO_ERROR);
Exit(mTestName, CHIP_NO_ERROR);
return;
}
Expand Down

0 comments on commit afe0fef

Please sign in to comment.