summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Use the new QMetaMethod API in testlibKent Hansen2012-03-212-18/+8
| | | | | | | | | | | | | Use QMetaMethod::name() instead of parsing the signature. Use QMetaMethod::returnType() instead of checking the length of typeName(). Use QMetaMethod::parameterCount() instead of checking the size of parameterTypes(). Change-Id: I424370b19b5b150865377666dca0fba5f29ad30f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* testlib: Remove obsolete internal compare_helper overload.Jason McDonald2012-03-214-27/+0
| | | | | Change-Id: Ic98faf360a713ac698f9bf1ff8aaad5a4c5c176b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Merge master into api_changesKent Hansen2012-03-193-8/+59
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
| * Make copy and assign private for QAccessibleEvent.Frederik Gladhorn2012-03-181-4/+4
| | | | | | | | | | | | | | | | | | Also make the handling of events in the test pointer based since mac-g++ doesn't seem to like const references the way they were before. Change-Id: I7fe39978d4729b8e586be30978b74aa51ca7cfe6 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Fix broken qWaitForWindowShown() behaviorCharles Yin2012-03-162-4/+55
| | | | | | | | | | | | | | | | | | | | qWaitForWindowShown() should check window->isActive() instead of window->isExposed() and return false if timeout. Add two new qWaitForWindowActive() and qWaitForWindowExposed() functions. Change-Id: Idd9601805c2e84b0d36ddd5471031b627d289953 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-163-27/+42
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp src/gui/kernel/qplatformsurface_qpa.cpp tests/auto/corelib/tools/qtimeline/qtimeline.pro Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
| * Improved qWaitForWindowShown().Samuel Rødal2012-03-151-11/+11
| | | | | | | | | | | | | | | | | | Made faster by actually waiting for the window to be exposed, using similar waiting logic as qWait(). Should speed up autotests that use it quite a bit. Change-Id: I628c6110a554fdbbf5bed7e91f57c2fe341113ed Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-151-7/+6
| | | | | | | | | | | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Deliver events in qtestmouseLaszlo Agocs2012-03-131-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Not waiting until the QPA event queue is processed after handleMouseEvent() is wrong. Unlike the synchronous sendEvent() calls these tests most likely utilized earlier, many of the QWindowSystemInterace functions are asynchronous in the sense that they just queue the event, delivery will happen when the event dispatcher on the main thread gets there. Change-Id: I8197d2dc4805cda684a8279ceb8d4b317f19aba7 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * Autotest details of QAccessibleEvent.Frederik Gladhorn2012-03-131-6/+17
| | | | | | | | | | Change-Id: Ieec33c23e7b18cfedf061088d6561203a5e7ac39 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Remove QTEST_NO_SPECIALIZATIONSOlivier Goffart2012-03-144-33/+0
| | | | | | | | | | | | | | | | We don't support these compiler anymore Change-Id: I0eb73535b6c11703299430e5fc24c8e17fed1653 Reviewed-by: Samuli Piippo <samuli.piippo@digia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-03-127-81/+116
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
| * Use QAccessibleEvent in test.Frederik Gladhorn2012-03-121-24/+26
| | | | | | | | | | Change-Id: I4f9c0f503543caa5704a29c8ccd7c4134b455625 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * testlib: Improve formatting of QCOMPARE failure messages.Jason McDonald2012-03-123-9/+9
| | | | | | | | | | | | | | | | | | | | | | Make the various versions of the failure message align consistently so that it's a little easier to compare the actual and expected values. Of course, the value won't align nicely unless the "actual" and "expected" strings are the same length, but at least this commit makes that consistent across all versions of the message. Change-Id: If9ce231df3b5d279a06f6458fdb5da0aa4586068 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Make QTestResult::verify() more robust.Jason McDonald2012-03-081-1/+3
| | | | | | | | | | | | | | | | | | | | The statementStr parameter should always be non-null, so assert if it is null. The description parameter can be null in some cases (particularly when the verify is successful, and thus no error description is going to be displayed), so tolerate this. Change-Id: I87b416d5f3b793bc608cd4aca14a4f7fe7527488 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Improve verbose and XPASS outputJason McDonald2012-03-086-48/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as "COMPARE()", making it impossible to see what was compared and difficult to match the output to the source of a test containing many calls to QCOMPARE. This commit changes testlib's internal compare_helper API so that string representations of the compared expressions are always passed to QTestResult::compare() when available, and can thus be shown in the verbose and XPASS output. The XPASS output has also been changed to state explicitly that the comparison succeeded unexpectedly, bringing it in line with the XPASS output resulting from a call to QVERIFY. This commit also changes all calls to compare_helper() to call the eight-argument version of the function, which simplifies much of the calling code. The now obsolete four-argument version of compare_helper() has been changed to output a warning that it is obsolete. It will be removed once other modules have had some time to catch up. The improved XPASS and verbose output is demonstrated by the expectfail and verbose2 selftests. Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * testlib: Document a known limitation of QFINDTESTDATA.Jason McDonald2012-03-081-0/+6
| | | | | | | | | | Change-Id: I72740e394bfe2a95f5b48566b29c9ef9200a8035 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Merge remote-tracking branch 'origin/api_changes' into containtersJoão Abecasis2012-03-085-53/+47
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetaobject.cpp src/corelib/kernel/qvariant.cpp src/tools/moc/moc.h Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
| * Fix sending simulated keyboard events to popup widgetsMiikka Heikkinen2012-03-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Popup widgets steal the keyboard grab stealthily without it being visible via QWidget::keyboardGrabber(). To more accurately simulate a real keyboard event, prioritize sending simulated keyboard events to the active popup widget over QGuiApplication::focusWindow(). Task-number: QTBUG-24326 Change-Id: Id7a75c613d934e24657b521f1684ce7cce92556a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-042-22/+12
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| | * Add operator<<(QTestData &, QStringBuilder)Olivier Goffart2012-02-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | So this code still compiles with QStringBuilder QTest::newRow("foo") << foo + bar; Change-Id: Ie82a21c8fd07ec2d27ad85015aa1a0c4e94700d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| | * Merge master -> api_changesRohan McGovern2012-02-293-9/+16
| | |\ | | | | | | | | | | | | | | | | | | | | Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac. Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
| | * | QTestlib: no need to use the preprocessor to distinguish qrealOlivier Goffart2012-02-271-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code paths are actually the same, so merge them. Change-Id: I456b8a9a825cccdd80cd6a52a0a6737cde252363 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * | | Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-022-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * | | testlib: Improve documentation of verbose test logging options.Jason McDonald2012-03-021-5/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | Change the help output to show which options only work for plain text logging. Change-Id: I39eb7cd0793cdbe553c230334c6cd532b4929f61 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | | Introduce QMetaType::UnknownType.Jędrzej Nowacki2012-03-022-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaType::Void was ambiguous, it was pointing to a valid type (void) and in the same time it was signaling errors in QMetaType. There was no clean way to check if returned type was valid void or some unregistered type. This feature will be used by new QMetaObject revision which will store type ids instead of type names. So it will be easy to distinguish between: void mySlot(); MyUnregisteredType mySlot(); Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Rename QMetaMethod::signature() to methodSignature()Kent Hansen2012-02-292-7/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | testlib: Improve the silent logging modeJason McDonald2012-02-282-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the silent logging mode suppressed passes, skips and internal testlib info messages, but did not suppress debugging output, making it hard to see the fails in a noisy test. This commit changes silent mode so that it suppresses all output except test failures and fatal errors, making silent mode truly useful for seeing just the important test output. This commit also adds a selftest to verify the behaviour of silent mode. Change-Id: I75420aead03682306210746a87e2a3b608b58fc6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | testlib: Remove commented-out code from plain text logger.Jason McDonald2012-02-281-2/+0
| | | | | | | | | | Change-Id: Ica2e294d1f08cac4697d037dbc2803012e0ba58a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | QtTest: add missing \since 5.0 to the new macrosDavid Faure2012-02-271-0/+6
| | | | | | | | | | Change-Id: I8f7060c41df1e0bf1a8c35930400a31a4239a3d6 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | clean up qmake-generated projectsOswald Buddenhagen2012-02-241-1/+0
|/ | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* CodeCoverage: Move installCoverageTool call.Caroline Chao2012-02-221-3/+3
| | | | | | | | | | | | Call it from qtest_qParseArgs() instead of qExec(). This will allow to remove the code coverage calls from quicktest. Both the installation and the saving of code coverage data are now gathered in testlib. Change-Id: If3baedb0cff9d894e6f232b947af7e3158703d9d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-211-1/+1
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use QMetaMethod::isValid() to check method validityKent Hansen2012-02-201-2/+2
| | | | | | | | | | The signature() method will soon be replaced by a function that returns a QByteArray rather than a pointer, and calling it will be more expensive than calling isValid(). Plus, isValid() looks nicer. Change-Id: I6844988c84dcadf876fc86bc71c8b310a21f88de Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* testlib: Report one test result per benchmark test.Jason McDonald2012-02-201-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit, a benchmark test could report 0..n passes and 0..m fails or skips, where n is the number of accumulation iterations used to collect benchmark data and m is the number of times the test function was invoked. Depending on the type of benchmark measurer being used, this could result in a very large volume of test output and inconsistent pass, fail and skip counts between test runs. This commit changes the behaviour so that each benchmark test reports one pass, fail or skip, regardless of the number of iterations used to collect benchmark data. This commit also prevents benchmark data being reported in the test output if the benchmark test failed or skipped, as any benchmark data is of dubious value in such cases. The latter change in behaviour requires a minor modification to the badxml selftest, which now tests quoting of literal strings in xml test output for both passing and failing benchmarks. Finally, this commit also adds a new selftest specifically for verifying correct behaviour for benchmarks that fail or skip. Task-number: QTBUG-24313 Change-Id: I3426dc659a7511b62fd183a031c7235bc753f497 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: make XPASS output slightly less confusing.Jason McDonald2012-02-201-1/+4
| | | | | | | | | | | | | | Prior to this commit, when an unexpected pass occurred the test output showed the message "XPASS : tst_foo::function() 'expr' returned FALSE", where the problem was actually that the expression evaluated to true when it was expected to be false. This commit changes the output to make it clear that the expression evaluated to true unexpectedly. Task-number: QTBUG-22118 Change-Id: Id22c178073d3b75789675ca37a8ef019029b1f91 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove usages of QT_ARCH and QT_ARCH_* from qtbaseBradley T. Hughes2012-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The architecture is detected at compile time based on the predefined macros from the compiler. Don't use QT_ARCH in .pro, .pri, or .prf files. The PNG_NO_ASSEMBLER_CODE define from libpng.pri is not present in the current copy of src/3rdparty/libpng, so no change in functionality is expected. The conditional for the SUPPORT_JIT define in pcre.pri is moved to src/3rdparty/pcre/config.h, again so that we can use the compiler's predefined macros to detect the architecture at compile time. Replace QT_ARCH_ARM, QT_ARCH_MIPS, and QT_ARCH_SPARC with their Q_PROCESSOR_* equivalents. Replace QT_ARCH_INTEGRITY, QT_ARCH_VXWORKS, and QT_ARCH_WINDOWSCE with their Q_OS_* equivalents. Note that this commit also effectively disables the SPARC atomic implementation. An inline implementation for SPARC needs to be added, or we remove the current code and instead rely on the GCC intrinsic or C++11 std::atomic support on SPARC. Note also that this commit does not remove QT_ARCH from configure or qconfig.h. This will continue to be set until all Qt 5 projects can be moved away from using QT_ARCH. Change-Id: I5de747cc4436d21941329974cff3016970f497b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* [QTBUG-22847] Compile with C++11 compilerMarc Mutz2012-02-171-1/+1
| | | | | | | | | | | | | | C++11 supports user-defined string literals, which makes the C++98-accepted literal string concatenation sequence "foo"MACRO illegal under C++11. The solution is to add whitespace between the string literal and the macro. For symmetry, this patch adds it on both sides. Change-Id: Ie0c698f610986c4d1b12dc2083489043b696936d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* testlib: Skip test function if init() fails.Jason McDonald2012-02-171-1/+1
| | | | | | | | | | | | | | | | | Prior to this commit, the following statement in the qtestlib documentation was untrue: "If init() fails, the following testfunction will not be executed, the test will proceed to the next testfunction." If init() called QSKIP, the test function would be skipped, but if init() reported a failure, the test function would still be executed (even though doing so could be unsafe). This commit makes testlib skip a test function if init() reports a failure and enhances the selftests to cover skips and fails in both init() and cleanup(). Task-number: QTBUG-20371 Change-Id: Id1cc8464ae0b8c257ae1b74dbe9189a501f5366b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: Remove obsolete version of QSKIP macro.Jason McDonald2012-02-161-11/+0
| | | | | | | | | | | A variadic version of the QSKIP macro has been left in qtestlib for a transitional period to give upstream projects time to catch up with the removal of the function from the API. This transitional period is now finished. Task-number: QTBUG-21652 Change-Id: Ib1a9158c2efbae05ffd0e69e72879f6387d4b2e8 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove code related to test location.Jason McDonald2012-02-163-27/+0
| | | | | | | | Testlib no longer does anything with the test location, and neither do any of Qt's tests, so the code is no longer needed. Change-Id: I1a464116179f3e26efadad6901f00f3c33e0ce84 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix compilation with MinGWJonathan Liu2012-02-151-1/+5
| | | | | | | | | | | | | Some headers and constants are available in MinGW-w64 that are not available in the official MinGW. STATE_SYSTEM_HASPOPUP and STATE_SYSTEM_PROTECTED constants are defined if they are not already defined by including oleacc.h. _CrtSetReportMode is not used and crtdbg.h is not included when using official MinGW as crtdbg.h is missing from official MinGW. Change-Id: Ie7f3f3726a1663d0fdeb6ee17b86873ae3f61860 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add missing crtdbg.h includeJonathan Liu2012-02-131-0/+3
| | | | | | | | _CrtSetReportMode requires crtdbg.h to be included. Change-Id: I7e2cbdf7e3087bbe115cd6a51024422b619ac552 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* testlib: Count passes, fails and skips consistently.Jason McDonald2012-02-133-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For data-driven tests, testlib previously counted one fail or skip for each data row that failed or skipped, while it counted only one pass for a test function where all rows passed and counted no passes for a test function where some rows passed and some rows failed. A similar problem also existed for benchmark tests, which could run multiple iterations of the same test, with each fail and skip being counted but only a single pass being counted for the entire series of iterations. This commit makes testlib count one pass, fail or skip for each data row. Test functions that are not data-driven count one result for the test function, as before. Benchmark tests count one pass, fail or skip per iteration. A side-effect of this change is that the test output in plain text, xml and light xml formats now shows a result for every data row and benchmark iteration executed, allowing post-processors to correctly calculate the total number of tests executed. Previously, individual rows were not shown in the test output if they passed, making such calculations impossible. The only change to the xunitxml output format is to correct a bug where no test result was recorded for a test function if the last data row was skipped and all other rows passed -- in which case the overall result should be a pass. Note that there is also a pre-existing bug in the xunit logger, where no result is reported if all rows are skipped; that bug is unaffected by this commit. Task-number: QTBUG-21848 Task-number: QTBUG-22124 Change-Id: I7e17177e10d6e89e55b9684c159bd506f21d002b Reviewed-by: Ed Baak <ed.baak@nokia.com>
* CodeCoverage: Handle QTest based subtests.Caroline Chao2012-02-123-4/+31
| | | | | | | | | | | | | | | | Set QT_TESTCOCOON_ACTIVE environment variable when the coverage is installed for a test and unset it when the coverage data is saved. Tests that run when QT_TESTCOCOON_ACTIVE is set are subtests and will not be considered as stand-alone tests for the coverage. When a test is run as a subtest its coverage data will not be saved for itself but for the main test it is merged with. Also its status will not be reported since only the status of the main test is expected in the test report, e.g. the test tests/auto/testlib/selftests. Change-Id: Icfdf99300aae18040e1a3441a8af21f68df4c0db Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Disable Assertion messagebox for unittests.Andreas Holzammer2012-02-081-0/+1
| | | | | | | | | | | | | A messagebox will be shown for an assertion in debug mode. This introduces a need for user interaction to proceed the execution of the unit test. Setting the Report mode to debug, will only print the assertion to stderr. Change-Id: If8ae80ea96d6608cba77b9c6ca176f97d1680932 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* testlib: Clear ignored messages after every data rowJason McDonald2012-02-083-5/+11
| | | | | | | | | | | | | | | | | | | | Previously, ignored messages were only cleared at the end of each test function, i.e. after all data rows were finished. This meant that if a data row in a data-driven test function didn't cause all of the expected messages to be generated, the remaining messages would be carried over to the next data row. This would result in errors about missing messages being associated with the last data row rather than with the correct data row. This commit makes testlib check for missing ignored messages after running each data row rather than only doing so after the last data row. This commit also adds a regression test to demonstrate that ignored messages can no longer be carried over from one data row to another. Change-Id: Ibee51aa6e96866fbcbcb4acee1a8340a86a6a4ba Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: Clear expected failures after every data row.Jason McDonald2012-02-083-2/+10
| | | | | | | | | | | | | | | | | | | | | | Previously, expected failures were only cleared at the end of each test function, i.e. after all data rows were finished. This meant that if a data-driven test function called QEXPECT_FAIL and then didn't perform any further verification steps to trigger the expected failure, the expected failure would be carried over to the next data row, probably causing the first verification step in the test function to XPASS (with a seemingly irrelevant error message) for the next data row. This commit adds the new function QTestResult::finishedCurrentTestData() to cleanup after each data row is executed. This function treats calls to QEXPECT_FAIL without subsequent verification steps as a test failure. This commit also adds a regression test to demonstrate that expected failures can no longer be carried over from one data row to another. If run against the previous version of testlib, the new test would report a pass instead of an error. Change-Id: Ida5c7f080815b0dca9531131fed582b0918334cb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* CodeCoverage: Save coverage data in QTestLog::stopLogging()Caroline Chao2012-02-074-20/+37
| | | | | | | | | | | | | | | | | Currently when tests are crashing, aborting or hanging, their status are reported with a status "Unknown" because SaveCoverageTool is never called for them. The status of the test given by the coverage tool should be the same as the one reported in the log output when the test is run. This change will allow more accuracy in the status reported. Add QTestResult::setCurrentAppname and QTestResult::currentAppname. To retrieve the name of the current application running. Task-number: QTQAINFRA-460 Change-Id: Icc476dc2d6cb28185e5447f1e79da6a8a31cad54 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Revert "Put the generated <module>version.h into build tree"Bradley T. Hughes2012-02-011-1/+1
| | | | | | | | | After discussion with Liang, I'm reverting it as he requested. This change put every header into the SYNCQT.HEADER_FILES twice for in-source builds, and the qtMODULEversion.h header did not include a path component. This reverts commit 2fbc45b58bba860abf67fb28aa1319c9f4ededaf Change-Id: Ie84cef19193ce5e49072f1f67a41140d9d2673b8 Reviewed-by: Liang Qi <liang.qi@nokia.com>