summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add support for the cache-related operations counters in benchlibThiago Macieira2013-03-061-23/+180
| | | | | | | | | | | | This adds support for checking cache accesses and misses, per operation (read, write and prefetch) as well as per cache level (L1 for data, L1 for instructions, last level). The branch prediction unit (BPU) is also accessed via the cache monitor subsystem. Change-Id: I8fa96b141cc777c9d231bd57fa36bca33ae7bdfd Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add support for more performance counters in QBenchlibThiago Macieira2013-03-063-8/+213
| | | | | | | | | | | | | Added support for most hardware and software counters available on Linux 3.3. The cache-based counters are missing because they need special handling. Also added an option that lists available counters. Note that the list is of counters the library knows about, not the counters that the hardware can measure. Change-Id: I9f6fb09b5460bf4ac6082081611c1d6ff806a3fa Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add more events for QBenchlib, based on the Linux perf countersThiago Macieira2013-03-063-12/+137
| | | | | Change-Id: Ic7e7e122bfe3995eb7ea033c744fd501579ea8fa Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Implement the Linux Perf Counter backend for benchlibThiago Macieira2013-03-063-2/+109
| | | | | | | | | | | | | | | | Currently, we only support one event type: counting CPU cycles with hardware counters. There are no fallbacks if this hardware counter is not available, and there is currently no way to specify other counters. Benchlib only supports reporting one event per benchmark, even though the event counter interface allows specifying more than one. Still, the hardware usually has limitations on how many events it can monitor at a time, and we'd prefer to have the counter running at 100% of the time, so this will not change. Change-Id: I79858a3ad1e696dc4b7b72c420e5a04b67cd55de Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add the skeleton Linux perf events counter for QtTestThiago Macieira2013-03-066-1/+224
| | | | | | | | Currently, it only prints "perf available" if you use the -perf option and perf is available. The implementation comes in the next commits. Change-Id: Ic6cdee70e21df25780799a4bc31ca2c2d923b9f8 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Import the Linux header linux/perf_event.hThiago Macieira2013-03-061-0/+615
| | | | | | | | | | | | | | Imported from linux's own git, at v3.7:include/uapi/linux/perf_event.h (blob SHA-1 is 4f63c05d27c91d04569971ea4a2c4849203c36a9). We cannot rely on the file being shipped by distributions. Older versions did not have all fields in the perf_event_attr structure. If those bits are enabled at runtime, the kernel will simply reject the perf_open call (-EINVAL). Currently, this can only happen with the non-default options exclude_guest and exclude_host. Change-Id: Ib329e52c21d6969406da0cf33de823d721d94206 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* iOS: Don't use IOKit in QTestLib, it's a private framework on iOSTor Arne Vestbø2013-02-271-5/+5
| | | | | Change-Id: I271a480b79c7768942911a28c84d6bb5a8d840d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Mention offscreen platform plugin in QTestLib documentation.Samuel Rødal2013-02-191-0/+6
| | | | | Change-Id: Icb82e0b4dedbe4978230cd3271f335ec07da60e4 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Giuseppe D'Angelo2013-02-176-15/+11
|\ | | | | | | refs/staging/dev