diff options
| author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-12-09 13:51:29 +1000 |
|---|---|---|
| committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-12-09 14:43:01 +1000 |
| commit | 200a8ac92afa0d8c5ff54c929a345dd3e05d3dd7 (patch) | |
| tree | e5750e009bec957663f44fda4706dcf62163f97c /src/quicktestlib/quicktestresult_p.h | |
| parent | 0298da6b7a93b87e951ce04b6b88bdbfe87db9c8 (diff) | |
Add benchmark support to the QML test framework
Test functions called "benchmark_foo()" will be run as
benchmarks inside an implicit QBENCHMARK {} block.
Diffstat (limited to 'src/quicktestlib/quicktestresult_p.h')
| -rw-r--r-- | src/quicktestlib/quicktestresult_p.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/quicktestlib/quicktestresult_p.h b/src/quicktestlib/quicktestresult_p.h index 4a283ea..a3c67be 100644 --- a/src/quicktestlib/quicktestresult_p.h +++ b/src/quicktestlib/quicktestresult_p.h @@ -54,7 +54,7 @@ class QuickTestResultPrivate; class Q_QUICK_TEST_EXPORT QuickTestResult : public QObject { Q_OBJECT - Q_ENUMS(FunctionType) + Q_ENUMS(FunctionType RunMode) Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged) Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged) Q_PROPERTY(FunctionType functionType READ functionType WRITE setFunctionType NOTIFY functionTypeChanged) @@ -79,6 +79,13 @@ public: CleanupFunc = 4 }; + // Values must match QBenchmarkIterationController::RunMode. + enum RunMode + { + RepeatUntilValidMeasurement, + RunOnce + }; + QString testCaseName() const; void setTestCaseName(const QString &name); @@ -131,6 +138,17 @@ public Q_SLOTS: void wait(int ms); void sleep(int ms); + void startMeasurement(); + void beginDataRun(); + void endDataRun(); + bool measurementAccepted(); + bool needsMoreMeasurements(); + + void startBenchmark(RunMode runMode, const QString &tag); + bool isBenchmarkDone() const; + void nextBenchmark(); + void stopBenchmark(); + public: // Helper functions for the C++ main() shell. static void parseArgs(int argc, char *argv[]); |
