diff options
author | Morten Sorvig <msorvig@trolltech.com> | 2009-08-10 08:14:12 (GMT) |
---|---|---|
committer | Morten Sorvig <msorvig@trolltech.com> | 2009-08-10 08:20:15 (GMT) |
commit | 7aa2d76dfc4a107f38c5cb0aac00a0b31d0fbbb6 (patch) | |
tree | eeeef851de0e762822380f9c77645c489bab4567 /src/testlib/qtestcase.cpp | |
parent | 2be387f3e94f84cf0167cdc3871de0d0af85c62d (diff) | |
download | Qt-7aa2d76dfc4a107f38c5cb0aac00a0b31d0fbbb6.zip Qt-7aa2d76dfc4a107f38c5cb0aac00a0b31d0fbbb6.tar.gz Qt-7aa2d76dfc4a107f38c5cb0aac00a0b31d0fbbb6.tar.bz2 |
Add QBENCMARK_ONCE to QTestLib.
The code block associated with QBENCHMARK_ONCE macro will only be executed once,
whether the backend returns a valid result or not. The "-iterations" command line
argument is also ignored.
This is useful for benchmarking code that has side effects.
Revby: jasplin
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 1866197..21a686e 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -351,6 +351,25 @@ QT_BEGIN_NAMESPACE {Chapter 5: Writing a Benchmark}{Writing a Benchmark} */ +/*! + \macro QBENCHMARK_ONCE + + \relates QTest + + This macro is used to measure the performance of code within a test. + The code to be benchmarked is contained within a code block following + this macro. + + Unlike QBENCHMARK, the contents of the contained code block is only run + once. The elapsed time will be reported as "0" if it's to short to + be measured by the selected backend. (Use) + + \sa {QTestLib Manual#Creating a Benchmark}{Creating a Benchmark}, + {Chapter 5: Writing a Benchmark}{Writing a Benchmark} +*/ + + + /*! \enum QTest::SkipMode This enum describes the modes for skipping tests during execution |