#include <UnitTestImp.h>
Public Slots | |
void | on_aboutButton_clicked () |
Shows the about dialog. More... | |
void | on_helpButton_clicked () |
Shows the help dialog. More... | |
void | on_startButton_clicked () |
Runs the unit tests. More... | |
void | on_treeViewFailure_itemDoubleClicked (QTreeWidgetItem *item, int column) |
Opens a dialog to display a detailed description about the error. More... | |
Public Member Functions | |
void | addUnitTest (const QString &unit) |
Adds a unit test. More... | |
void | clearErrorList () |
Empties the error listview. More... | |
void | clearUnitTests () |
Clears the unit tests. More... | |
QString | getUnitTest () const |
Returns the unit test. More... | |
void | insertError (const QString &failure, const QString &details) |
Inserts an item with text failure to the listview. More... | |
void | reject () |
Closes and resets this dialog. More... | |
void | reset () |
Resets this dialog. More... | |
void | setErrorCount (int) |
Sets the number of faulty tests to ct. More... | |
void | setFailCount (int) |
Sets the number of failed tests to ct. More... | |
void | setProgressFraction (float fraction, const QString &=QString()) |
Sets the progress of the progress bar whereas fraction is in between 0.0 and 1.0. More... | |
void | setRemainCount (int) |
Sets the number of remaining tests to ct. More... | |
void | setRunCount (int) |
Sets the number of performed tests to ct. More... | |
void | setStatusText (const QString &text) |
Sets the text in the status bar. More... | |
void | setUnitTest (const QString &unit) |
Sets the unit test. More... | |
void | showErrorDialog (const char *title, const char *message) |
Shows an error dialog with title and message. More... | |
Static Public Member Functions | |
static void | destruct () |
Destructs the instance of this dialog. More... | |
static bool | hasInstance () |
Returns true if an instance of this dialog exists, false otherwise. More... | |
static UnitTestDialog * | instance () |
Creates and returns the one and only instance of this dialog. More... | |
Protected Member Functions | |
void | setProgressColor (const QColor &col) |
Sets the color to the progressbar to col. More... | |
UnitTestDialog (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags()) | |
Constructs a TestGui::UnitTestDialog as a child of 'parent', with the name 'name' and widget flags set to 'f'. More... | |
~UnitTestDialog () | |
Destroys the object and frees any allocated resources. More... | |
|
protected |
Constructs a TestGui::UnitTestDialog as a child of 'parent', with the name 'name' and widget flags set to 'f'.
The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog.
References setProgressColor().
Referenced by instance().
|
protected |
Destroys the object and frees any allocated resources.
void UnitTestDialog::addUnitTest | ( | const QString & | unit | ) |
Adds a unit test.
If a test with name unit already is added then nothing happens.
Referenced by TestGui::UnitTestDialogPy::addUnitTest(), and setUnitTest().
void UnitTestDialog::clearErrorList | ( | ) |
Empties the error listview.
Referenced by TestGui::UnitTestDialogPy::clearErrorList().
void UnitTestDialog::clearUnitTests | ( | ) |
Clears the unit tests.
Referenced by TestGui::UnitTestDialogPy::clearUnitTests().
|
static |
Destructs the instance of this dialog.
QString UnitTestDialog::getUnitTest | ( | ) | const |
Returns the unit test.
|
static |
Returns true if an instance of this dialog exists, false otherwise.
void UnitTestDialog::insertError | ( | const QString & | failure, |
const QString & | details | ||
) |
Inserts an item with text failure to the listview.
details will be shown when double-clicking on the matching listitem.
Referenced by TestGui::UnitTestDialogPy::insertError().
|
static |
Creates and returns the one and only instance of this dialog.
References Gui::getMainWindow(), and UnitTestDialog().
Referenced by TestGui::UnitTestDialogPy::addUnitTest(), TestGui::UnitTestDialogPy::clearErrorList(), TestGui::UnitTestDialogPy::clearUnitTests(), TestGui::UnitTestDialogPy::errorDialog(), TestGui::UnitTestDialogPy::getUnitTest(), TestGui::UnitTestDialogPy::insertError(), TestGui::UnitTestDialogPy::setErrorCount(), TestGui::UnitTestDialogPy::setFailCount(), TestGui::UnitTestDialogPy::setProgressFrac(), TestGui::UnitTestDialogPy::setRemainCount(), TestGui::UnitTestDialogPy::setRunCount(), TestGui::UnitTestDialogPy::setStatusText(), and TestGui::UnitTestDialogPy::setUnitTest().
|
slot |
Shows the about dialog.
|
slot |
Shows the help dialog.
|
slot |
Runs the unit tests.
References Base::Interpreter(), reset(), Base::InterpreterSingleton::runString(), setProgressColor(), and showErrorDialog().
|
slot |
Opens a dialog to display a detailed description about the error.
void UnitTestDialog::reject | ( | void | ) |
Closes and resets this dialog.
References reset().
Referenced by draftguitools.gui_hatch.Draft_Hatch_TaskPanel::accept(), draftguitools.gui_setstyle.Draft_SetStyle_TaskPanel::accept(), drafttaskpanels.task_shapestring.ShapeStringTaskPanelCmd::accept(), drafttaskpanels.task_shapestring.ShapeStringTaskPanelEdit::accept(), drafttaskpanels.task_shapestring.ShapeStringTaskPanel::action(), femexamples.examplesgui.FemExamples::clicked(), and PathScripts.PathToolBitLibraryGui.ToolBitLibrary::toolEdit().
void UnitTestDialog::reset | ( | void | ) |
Resets this dialog.
Referenced by on_startButton_clicked(), reject(), and draftguitools.gui_trackers.gridTracker::set().
void UnitTestDialog::setErrorCount | ( | int | ct | ) |
Sets the number of faulty tests to ct.
Referenced by TestGui::UnitTestDialogPy::setErrorCount().
void UnitTestDialog::setFailCount | ( | int | ct | ) |
Sets the number of failed tests to ct.
Referenced by TestGui::UnitTestDialogPy::setFailCount().
|
protected |
Sets the color to the progressbar to col.
Referenced by on_startButton_clicked(), setProgressFraction(), and UnitTestDialog().
void UnitTestDialog::setProgressFraction | ( | float | fraction, |
const QString & | color = QString() |
||
) |
Sets the progress of the progress bar whereas fraction is in between 0.0 and 1.0.
It also sets the color of the progress bar to red if a failure or error in the unit test occurred.
References setProgressColor().
Referenced by TestGui::UnitTestDialogPy::setProgressFrac().
void UnitTestDialog::setRemainCount | ( | int | ct | ) |
Sets the number of remaining tests to ct.
Referenced by TestGui::UnitTestDialogPy::setRemainCount().
void UnitTestDialog::setRunCount | ( | int | ct | ) |
Sets the number of performed tests to ct.
Referenced by TestGui::UnitTestDialogPy::setRunCount().
void UnitTestDialog::setStatusText | ( | const QString & | text | ) |
Sets the text in the status bar.
Referenced by TestGui::UnitTestDialogPy::setStatusText().
void UnitTestDialog::setUnitTest | ( | const QString & | unit | ) |
Sets the unit test.
If the item is not there yet it gets added.
References addUnitTest().
Referenced by TestGui::UnitTestDialogPy::setUnitTest().
void UnitTestDialog::showErrorDialog | ( | const char * | title, |
const char * | message | ||
) |
Shows an error dialog with title and message.
Referenced by TestGui::UnitTestDialogPy::errorDialog(), and on_startButton_clicked().