summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Fix QtTest function-unused warnings found by Clang 3.4Thiago Macieira2014-01-172-7/+7
| | | | | | | | The front-end functions in the QTest namespace are declared static inline, so the compiler can complain. Make it not do so. Change-Id: I4036c85010e02ef22a8071ed05e49173dfc64729 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Windows: Do not print test output to both stdout and system debug logKai Koehne2014-01-131-1/+9
| | | | | | | | | | | | | | | Avoid piping the test output to both the Windows system debugger, and stdout. This fixes duplicate output in Qt Creator, which displays messages from both sources. [ChangeLog][QtTestLib] The (default) plain text logger on Windows now logs to either the system debug log (in case no console is open), or stdout, not both. Task-number: QTBUG-34630 Change-Id: I35fe9f4a50cc660d79fad7dffa6d19659b2102ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix file descriptor leak in the perf event counterThiago Macieira2014-01-101-9/+11
| | | | | | | | | | | We opened the counter at every start(), even if we had already started before. Some of the benchlib's options caused it to start() and stop() over and over again, like -minimumvalue and -minimumtotal, which could leak to fd exhaustion (EMFILE). Change-Id: Ifeb7cca65c758877be600dc22928bea74f499934 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* QTestLib: use QT_MESSAGE_PATTERN when showing debug outputDavid Faure2014-01-061-1/+6
| | | | | | | | | | | This makes debugging much more convenient, being able to see e.g. the method name where qDebug is used. Note that this doesn't break ignored messages, since qMessageFormatString is only called after the test for ignored messages. Change-Id: I7fc96e3f19efe48ac3a30fdd63e5b495c0d86e02 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Doc: added qtquick to depends statement in qttestlib.qdocconfNico Vertriest2013-12-201-1/+1
| | | | | | Task-number: QTBUG-34749 Change-Id: I150cbf0e7077f725579cdcd3151ce684b1f64172 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Revert "Add tracing to logging framework"Kai Koehne2013-11-071-1/+0
| | | | | | | | | | | | | | | | | | | The tracing API still misses some real-world exposure. Let's re-do this in dev to have more time. This reverts parts of following commits: 466e0dff4bb686e51d0ab3f905631fcb7dd8bfef 7a47aebe9ed41d6cd9c9bcd45758d4d553668e99 a652bab6a7ebf78b029fea95c2801deb6f4f524a 8f0654ceb878b6c8a08c7f5b790027c26e007c13 4162522edd9d31bd2798ab37f083adff818d886e 32f27b4367c4e042a3f0cda671579494e31c1d69 9ff81bdc1ab4e3d14914192cd63ae625a507fe90 Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-1/+1
| | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Revert "QTest: use nth_element to calculate the median"Marc Mutz2013-11-041-5/+4
| | | | | | | | | | This reverts commit 48586b2bac623605e9f300f8e5380e4f4b484dab. This causes problems in QtCreator without anyone being able to say why. Task-number: QTBUG-34397 Change-Id: I9ea5457724d5af8d87e0bc40e6615748daf9c04c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Added a link to the Qt Quick Test pageVenu2013-10-231-0/+1
| | | | | | | Task-number: QTBUG-33316 Change-Id: Ib8c479837cac4b7cca47b979cbb2dad0aaae6412 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix synqt-warnings in QTestLib.Friedemann Kleint2013-10-141-1/+1
| | | | | | | | | QtTest: WARNING: qtestmouse.h includes QDebug when it should include QtCore/QDebug. Introduced by c2106683461bc02da95f7bd014eca17beeec4319 . Change-Id: I33918c82fddeedef90597bf02c93167348d6b279 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-083-11/+11
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* testlib: Don't link to IOKit on iOS, it's not part of the SDKTor Arne Vestbø2013-10-031-4/+2
| | | | | | | | | IOKit used to be part of the 5.x and 6.x iOS SDKs, but not officially, so when Apple in the iOS 7 SDK removed IOKit headers and the library symlink, our builds started failing. Change-Id: I631cab7c106559968c06977fa25157a57402594c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Doc: remove duplicate \externalpage definitionsTopi Reinio2013-09-261-4/+0
| | | | | | | | Delete all duplicate \externalpage definitions from corelib, printsupport and testlib sources. Change-Id: I7dc5358861f4dad3e8ce080619b61ca3da64ec85 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Expose QTest::currentAppName() and remove hard-coded argv[0] in testsTor Arne Vestbø2013-09-265-10/+20
| | | | | | | | Except where we're actually testing QCoreApplication::applicationName() and friends. Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Add tracing to logging frameworkhjk2013-09-251-0/+1
| | | | | | | | | Change-Id: I4d5b9a24a214785019ff1238c1790ead79205b15 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix: warning/compilation issue on androidaavit2013-09-251-1/+1
| | | | | | | | | | | Compiler would complain "error: format not a string literal and no format arguments [-Werror=format-security]", since the third argument of __android_log_print() is actually the format string. __android_log_write() is anyway more suited since we're not using any format here. Change-Id: Ic19102a9f15038a7cfcb06b605d7b9a73c3e1175 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Support logcat output from tests on AndroidEskil Abrahamsen Blomfeldt2013-09-241-0/+6
| | | | | | | | | We usually do not have a console, so print out the messages to the log as well, so that it's easier to run single tests for debugging. Change-Id: I31908977aac25a6f6716f8245206b01026234aa9 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* QTest: microoptimisationMarc Mutz2013-09-211-1/+1
| | | | | Change-Id: Ifd053870c270a2c0a0a33c8201e40aaa9a9f9041 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* WinRT: Basic global supportAndrew Knight2013-09-201-5/+7
| | | | | | | | Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* QTest: use nth_element to calculate the medianMarc Mutz2013-09-131-4/+5
| | | | | | | Sorting is O(NlogN) complexity, while nth_element is linear. Change-Id: Ic6596affe183494e87abe7bdaa7c9985f5b7cd58 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove qSort usages from QtTestlibGiuseppe D'Angelo2013-09-111-1/+2
| | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I383d13f76eceae025daab5242f433f694c0149cd Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-212-36/+12
|\ | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
| * Fix mouse test event in window warning message.Martin Jones2013-08-181-1/+5
| | | | | | | | | | | | | | | | | | The tests use local coordinates, but window->geometry() gives the global position on the window, i.e. offset by the size of the decoration. Change-Id: Id63ffd7e160b77ddb0f5563d8c3c65c36ad45e89 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * Don't use deprecated qInstallMsgHandler in testlibKai Koehne2013-08-161-35/+7
| | | | | | | | | | | | | | | | | | | | | | | | We kept using qInstallMsgHandler in testlib to not break test cases using it too. However, this breaks tests using qInstallMessageHandler ... ChangeLog: QTestLib: Test cases have to use qInstallMessageHandler instead of the (deprecated) qInstallMsgHandler Task-number: QTBUG-32391 Change-Id: I3bd95d9b0a48749243a5dd3e074df8ebcbc07dce Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Ensure that output is world readable on AndroidEskil Abrahamsen Blomfeldt2013-08-051-0/+10
| | | | | | | | | | | | | | | | | | | | On Android, we need to be able to get access to the output file remotely, so we make it world-readable. Task-number: QTBUG-32079 Change-Id: I0a53a952d03339c0f1a1316f38bd206075589bde Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Simo Fält <simo.falt@digia.com>
* | Doc: Setting module pages' \qtvariable.Jerome Pasion2013-08-021-0/+1
| | | | | | | | | | | | | | | | | | Argument to \qtvariable is the QT variable needed for linking to the module. Task-number: QTBUG-32172 Change-Id: I181c0cfaf9529f3aea741cdaee0f20d6cd0e2d2f Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-0/+10
|\| | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * Fix compilation of QtTest on Linux systems with old kernel headersThiago Macieira2013-07-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Hardcode our perf_event_open(2) function to simply return -1 and set errno to ENOSYS. This will disable the functionality. People compiling Qt with such old headers will probably carry quite a bit of dead code in QtTest. They should upgrade. Task-number: QTBUG-32507 Change-Id: I774b4a81bee5c3e2ddc75fa52520d123a6bebed9 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | TestLib: align the colons so the "actual" and "expected" align tooThiago Macieira2013-07-211-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: FAIL! tst_testcase::testcase: Compared values are not the same Actual (actual): F0O Expected (expected): FOO Now: FAIL! tst_testcase::testcase: Compared values are not the same Actual (actual) : F0O Expected (expected): FOO Change-Id: I6f0768e4ef53e065b85a56879cecbad06fa34aef Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | Testlib: Add a crash handler for Windows that prints a message.Friedemann Kleint2013-07-171-0/+13
| | | | | | | | | | Change-Id: I4d6559fd1b21f9f259be6a5a160361e25ea0d217 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | QTestlib: Re-enable Windows error dialog when -nocrashhandler is passed.Friedemann Kleint2013-07-152-13/+12
| | | | | | | | | | | | | | | | | | The error dialog is sometimes desired when trying to attach a debugger. Use the -nocrashhandler option for it, which already exists on UNIX. Change-Id: I42c9311242cdeaa81a148af9bf61875e1bc6f32c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Doc: Adding navigation configs in the module qdocconf files.Jerome Pasion2013-06-251-0/+3
|/ | | | | | | | -The navigation bar requires the titles of the landing page and relevant pages. Change-Id: I5d5986b2bf74205cd49957b63fd6ac4e32cbb36b Reviewed-by: Martin Smith <martin.smith@digia.com>
* QtTest: Output correct library nameSze Howe Koh2013-05-272-2/+2
| | | | | | | | | | | "QTest" is the C++ namespace; "QtTest" is the library name - Edited the logger output in qplaintestlogger.cpp - Updated documentation - Updated expected outputs for self-tests Change-Id: I43c525c43221a8d4e843a00d6d55b0f06ef55fd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warning about deprecated APIKai Koehne2013-05-221-0/+10
| | | | | | | | Explicitly disable warnings about qInstallMsgHandler being deprecated. We have to use it in testlib to not break test cases still using it. Change-Id: Icf7eb6c4d549f80ef45a4201fab2ac3eb03dda9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Utilize the new Q_OS_MACX define.Jake Petroules2013-05-091-5/+5
| | | | | | | | | | All occurrences of `#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)` have been replaced with `#if defined(Q_OS_MACX)`. Change-Id: I5055d9bd1845136beb8ed1c79a8f0f2c0897751a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix more warnings, found by cross-compiling QtThiago Macieira2013-05-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | KeccakF-1600-opt32.c:497:5: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] harfbuzz-thai.c:264:49: error: comparison is always false due to limited range of data type [-Werror=type-limits] These warnings are caused by "char" defaulting to unsigned on ARM. In particular, the second warning was introduced by commit 785e95ef0a95ca8fb39ef57678cd4876ee657c43, which is not upstream... qbenchmarkvalgrind.cpp:224:5: error: variable ‘_qzz_res’ set but not used [-Werror=unused-but-set-variable] This one was fixed for x86-64 in 7b54571ec2032628ea71b0af but not for the other platforms. KeccakF-1600-opt32.c:250:5: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] This one is wasn't caught before because it applies only to big-endian code. Change-Id: Ice33b639e55d95140cbf912bb81b6f508ed3744a Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the QTouchEventSequence code snippet so that it compilesAndy Shaw2013-04-181-2/+2
| | | | | | | | | The release() function also requires the QPoint to be set which was missing from the code snippet. Change-Id: I4a5cd2bed0915eb1fbaac3a34fb229eac9c284df Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Warn if mouse event occurs outside target window in tests.Stephen Kelly2013-04-121-0/+3
| | | | | | | | | | | This class of bug seems to occur in 'flaky' CI tests, so give more information about what the problem is. Found here: https://codereview.qt-project.org/#change,44210 Change-Id: I73908e309bdecf1fd3bc323dd4e8febe47c1239a Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* qWaitForWindow* default timeouts are 5 secondsShawn Rutledge2013-03-231-2/+2
| | | | | | | | | A widget window can be expected to show up faster, but on a busy CI machine, OpenGL windows can take longer than 1 second. Change-Id: I572cc86bf4d8beebcc565db8d6f2ff78e55c2ac0 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Fix error in XML and Xunit formatted benchmark output.Mirko Boehm (AWS)2013-03-222-2/+5
| | | | | | | | | | | | The number of iterations was not respected for XML output, unlike for plain text output. With this fix, benchmarks report the same result for plain text and XML formatted output. Compare the change to qplaintextlogger.cpp:274. Change-Id: Ieb3e5812e18d93c36847bef0417f779efd300f86 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Daniel Molkentin <daniel@molkentin.de> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add minimumtotal option to improve accuracy of short-lived benchmarks.Mirko Boehm (AWS)2013-03-194-1/+33
| | | | | | | | | | | | | | | | | Short-lived benchmarks (benchmarks that complete in a very short period of measured time) are often more affected by jitter and warm-up effects than longer running benchmarks. Since QBENCHMARK stores the median result of all accepted benchmark runs, a larger number of aggregation runs is preferable for short-lived tests, but not necessarily for longer running ones. The minimumtotal option, specified in units of the selected measurement, will make the benchmark repeat a benchmark until the total measured cost exceeds the specified threshold. The displayed median result will then tend to be more accurate. This is especially useful for data-driven benchmarks in case the data tags scale the benchmarked operation from little to large cost. Change-Id: Ib857de64aaffc77715a0000d36f0245f31d86b9a Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Make sure that we #include qconfig.h before testing for features.Thiago Macieira2013-03-191-0/+2
| | | | | | | | | | | This is mandatory in public headers (qiodevice.h, qopengl*, etc.), but it's a good idea even in private headers, in case someone includes that header first somewhere. In particular, all platformsupport API is private. Change-Id: If287baa5d9ed14e93c1666efa0e6332c4c1cd9a4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* make testlib's toString() use local8Bit, not latin1Oswald Buddenhagen2013-03-131-9/+9
| | | | | | | | | | | this is consistent with what qDebug does. consequently, this makes the code usable with 8-bit strings in the first place. note that some {to,from}Latin1 is left - this is where we know that we are dealing with ascii-only text. Change-Id: I26cfdf3622250b8bf95ebfe221465ca89d7cd082 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* fix encoding when printing debug under winceOswald Buddenhagen2013-03-121-1/+1
| | | | | | | the strings are in local8bit format, not latin1 Change-Id: I19f20b0310351aacb26b70d8053ed267e710986f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* don't clobber 8-bit outputOswald Buddenhagen2013-03-121-2/+2
| | | | | | | | otherwise it becomes useless for utf-8. the output is encoded as local8bit, so it shouldn't be garbage. Change-Id: I68e59bddb092ac53746f421a90e3803632dbf1c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android build fixPaul Olav Tvete2013-03-121-1/+1
| | | | | | | Apparently, the Linux Perf Counter is not supported on Android. Change-Id: I38115d140a3ee783bfcd8a984d8832ffe5bbace4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Silence warning about unused fields in test event (CLANG).Friedemann Kleint2013-03-121-1/+1
| | | | | Change-Id: I8e05fc9b8820136a7714219627dbdae300af0b0d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Add support for attributes in the -perfcounter argumentThiago Macieira2013-03-061-1/+38
| | | | | | | | | Five attributes are supported, matching what the perf(1) tool supports. The 'p' attribute (precise IP reporting) wasn't added because we don't do assembly-level debugging with benchlib. Change-Id: I726f735a5bcc0c97e62cde0fbe0843597068ad7c Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Store the performance counter attributes globallyThiago Macieira2013-03-061-22/+27
| | | | | | | This will allow us to modify more attributes from the command-line Change-Id: I84d4933cbfa2b69c4e1009eaf3e005cfc3e7e01c Reviewed-by: Jason McDonald <macadder1@gmail.com>