Gui: make unit tests working from command line if Gui is up

This commit is contained in:
wmayer
2022-12-24 19:13:40 +01:00
parent 1e7edb46e4
commit 3c709f31df
4 changed files with 44 additions and 9 deletions

View File

@@ -274,6 +274,19 @@ QString UnitTestDialog::getUnitTest() const
return ui->comboTests->currentText();
}
/**
* Runs the currently selected test and closes the dialog afterwards.
* It returns true if all tests have passed and false otherwise.
*/
bool UnitTestDialog::runCurrentTest()
{
clearErrorList();
on_startButton_clicked();
int count = ui->treeViewFailure->topLevelItemCount();
reject();
return (count == 0);
}
/**
* Sets the text in the status bar.
*/