|
Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Sets up a widget test based on the command-line arguments of the test function. More...
#include <Libs/MRML/Widgets/qMRMLTestingSetup.h>
Public Member Functions | |
| QString | errorString () const |
| int | eventPlaybackDelay () const |
| bool | interactive () const |
True if interactive mode is requested (-I). | |
| bool | isValid () const |
| Returns false if an option has a missing or invalid value. See errorString() for details. | |
| QString | positionalArgument (int index, const QString &defaultValue=QString()) const |
| Returns the positional argument at the given index, or defaultValue if there is no such argument. | |
| QStringList | positionalArguments () const |
| Arguments that are not testing options, in their original order. | |
| qMRMLTestingSetup (int argc, char *argv[]) | |
Protected Member Functions | |
| void | applySettings () const |
| void | parse (const QStringList &arguments) |
Protected Attributes | |
| QString | ErrorString |
| int | EventPlaybackDelay { -1 } |
| bool | Interactive { false } |
| QStringList | PositionalArguments |
Sets up a widget test based on the command-line arguments of the test function.
The constructor parses the arguments and applies the testing settings that they specify, such as the QtTesting event playback delay (this changes application-wide testing state).
Options are recognized anywhere on the command line and they are not included in positionalArguments():
-I: interactive mode. The test should not quit or play back recorded events automatically.--event-playback-delay <ms>: delay between played back QtTesting events, in milliseconds. Zero delay makes tests run faster, while the QtTesting default delay allows watching the playback.Example:
Definition at line 52 of file qMRMLTestingSetup.h.
| qMRMLTestingSetup::qMRMLTestingSetup | ( | int | argc, |
| char * | argv[] ) |
Parse arguments of a test function and apply the specified testing settings. The first argument (argv[0]) is the test name and it is ignored. If the arguments are invalid then the error is logged and settings are not applied.
|
protected |
Apply testing settings that are specified in the options (currently the QtTesting event playback delay). Settings that are not specified are not changed.
| QString qMRMLTestingSetup::errorString | ( | ) | const |
| int qMRMLTestingSetup::eventPlaybackDelay | ( | ) | const |
Delay between played back QtTesting events, in milliseconds. Returns -1 if the delay is not specified.
| bool qMRMLTestingSetup::interactive | ( | ) | const |
True if interactive mode is requested (-I).
| bool qMRMLTestingSetup::isValid | ( | ) | const |
Returns false if an option has a missing or invalid value. See errorString() for details.
|
protected |
| QString qMRMLTestingSetup::positionalArgument | ( | int | index, |
| const QString & | defaultValue = QString() ) const |
Returns the positional argument at the given index, or defaultValue if there is no such argument.
| QStringList qMRMLTestingSetup::positionalArguments | ( | ) | const |
Arguments that are not testing options, in their original order.
|
protected |
Definition at line 85 of file qMRMLTestingSetup.h.
|
protected |
Definition at line 83 of file qMRMLTestingSetup.h.
|
protected |
Definition at line 82 of file qMRMLTestingSetup.h.
|
protected |
Definition at line 84 of file qMRMLTestingSetup.h.