Use QVERIFY2() with QTemporaryDir/File::errorString() consistently.
Attempt to catch issues like the below warning and follow-up issues.
QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa" (Access is denied.)
Task-number: QTBUG-47370
Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Make it easier to capture information about crashing tests in log files,
since it is not possible to do something like
foo > log.txt 2> errlog.txt
on Windows.
Adapt selftest.
[ChangeLog][QtTest][Important Behavior Changes] Crash/exception
information is now logged to standard output on Windows.
Task-number: QTBUG-47370
Change-Id: I3e6a2d25855ed0f20516418a031990b562f5f757
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
[ChangeLog][Important Behavior Changes] QDebug output for QStrings
changed compared to Qt 5.5.0 to more closely match the output of
previous Qt versions. Like Qt 5.5.0, QDebug will escape non-printable
characters, the backslash and quote characters, but will no longer
escape the printable characters.
Task-number: QTBUG-47316
Change-Id: I52dd43c12685407bb9a6ffff13f62ef68cbc80c5
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Add QTRY_VERIFY2_WITH_TIMEOUT() similar to QTRY_VERIFY_WITH_TIMEOUT()
except that QTRY_VERIFY2() is used below the loop and QTRY_VERIFY2()
based on it.
Add tests to cmptest.
[ChangeLog][QtTest] Added macros QTRY_VERIFY2_WITH_TIMEOUT(), QTRY_VERIFY2()
making it possible to output a message after the timeout has expired.
Change-Id: I587e24f3aeb73542dbf3ccb936a16f2e0806555f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
From MSVC 2015 onwards, MSVC formats floats using printf("%g") like
g++, so the fiddling of the expected output needs to restricted
accordingly.
Change-Id: I6e7f78e5e90f70886a8b2ef37c0fb9bf82b5e1a3
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This is for example useful when looking for a possible BLACKLIST
file while doing a shadow build.
Add autotests for blacklist.
Change-Id: I41d3939d31d21d10187fefcb82604736d911b6ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Dump a stack trace on Linux if the process crashes. This will give us
much better log output in the new CI system. In addition, create a
watch dog thread, that kills the test if the test function times
out (ie. hangs)
Implementations of the stack trace dumping for Mac and Windows
are still pending.
Change-Id: I65426c5afe290a0a2019b881436a0c278f1cafaf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Similar to what we've done to QString, only we print each byte that is
not ASCII as \OOO (octal representation).
[ChangeLog][QtTest] QtTest now prints an escaped version of
QByteArrays that failed to compare with QCOMPARE, instead of the hex
dump.
Change-Id: I6a8c43f138c66c998280998a242b43cd579666a0
Reviewed-by: Richard J. Moore <rich@kde.org>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
Selftests for testlib fail when executed in UTC timezone because local and
UTC are the same, but expected to be different. A custom timezone is used
instead.
Debug output of qCompare does only handle local and non-local timezones, using
new Qt5 features allows to show the correct timezone in format string.
Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4
Reviewed-by: Jason McDonald <macadder1@gmail.com>
[ChangeLog][QtCore][QDebug] Printing of QStrings and QStringRefs
whenever "noquote" is not active now prints the strings in a format that
can be copied back to C++ code. All characters that aren't printable in
US-ASCII are escaped (this includes printable Unicode characters outside
of US-ASCII). Pretty-printing will not respect QTextFormat padding or
field widths.
Change-Id: I169a8a0508e24693f5652f0129defe7f709e5d08
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add an 'info' message type that can be used for messages that are neither
warnings (QtWarningMsg), nor for debugging only (QtDebugMsg). This is
useful mainly for applications that do not have to adhere to the
'do not print anything by default' paradigm that we have for
the Qt libraries itself.
[ChangeLog][QtCore][Logging] QtInfoMsg got added as a new QtMsgType.
Use the new qInfo(), qCInfo() macros to log to it.
Change-Id: I810995d63de46c41a9a99a34d37c0d417fa87a05
Reviewed-by: Jason McDonald <macadder1@gmail.com>
We need to have a finer grained control over the tests
we skip in our CI system. This adds a blacklisting
mechanism that allows blacklisting individual test
functions (or even test data) using a set of predefined
matching keys for the operating system and some other
relevant variables.
QTestlib will search for a file called BLACKLIST in the test
directory and parse it if found. The file contains a simple
ini style list of functions to blacklist. For details see
qtestblacklist.cpp.
Change-Id: Id3fae4b264ca99970cbf9f45bfb85fa75c1fd823
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
GRAPHICS_ROOT and TZ environment variables are needed in child
processes in order to successfully run the auto test selftests.
Change-Id: I7befabd535b4c47b1e75acbe3d6158d0d9b811b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Added the function pointer constructor to QSignalSpy to take advantage
of the new connect syntax.
Change-Id: I94218a096c677cdba73e1b2cfa8b9c09bc28145f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Output the file name and fix line number to be 1..n.
Change-Id: I3ba7f84b99ce3664bc3e403b230307511b15fe1f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.
[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.
Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This is only useful for logging benchmarks, since it won't print test
passes, failures, etc. It's useful for importing to spreadsheets to do
number-crunching.
[ChangeLog][QtTest]Added a CSV logging mode that is suitable for
importing benchmark results into spreadsheets. This can be enabled by
the -csv option on the command-line. The CSV logging mode will not print
test failures, debug messages, warnings, etc.
Change-Id: I245d6f86bb380645c9bc0d748cf474b3ed42cab8
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Task-number: QTBUG-35743
[ChangeLog][QtTest][Windows] Use correct UTF-8 encoding for XML test results on platforms with different console encoding.
Change-Id: Ice9d03192098f931e5dac358928e0c4421ab715e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Do not apply additional encoding when reading process output.
Fixes errors when encountering UTF-8:
Traceback (most recent call last):
File "./generate_expected_output.py", line 117, in <module>
generateTestData(path)
File "./generate_expected_output.py", line 106, in generateTestData
out.write(data.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 5485: ordinal not in range(128)
Change-Id: Ib827787a59a18b4d3d0601645856517f43c01fc3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Evaluate command line arguments and use directories only when empty.
Change-Id: I818ec13c686018a3f607e91174e57d8f8bbf15f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
The actual code in testlib now indents the duration tag when it is for a
function.
Change-Id: Iee62db9c81f11dc54e57f166bf9fb2b7012b7e03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
[ChangeLog][QtTest] Added test duration to xml output.
When running tests with xml output a new tag of the form
<duration msecs="123"/> is added to each test function and the test as a
whole.
Change-Id: Ibc4db066b6acf5fac6c578f5e5ca5ce4b5d8ea8e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
The units that were supposed to have variance were completely off in the
test leading to all benchmarks with slight variance being completely
flaky.
Change-Id: Ib76593813974adee462b3f03be9370d2248d770c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
This makes testlib a lot more hackable since when the output is changed
in a defined way we can regenerate the expected output (eg adding the
test duration which will be a follow-up patch).
Note that the script does not work properly on Windows and not all
benchmarks work, but at least it reduces the work of adapting files to a few lines.
Change-Id: I910387cd92ff82aa629747a3a3033dae17fbd711
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The newly added generate_expected_output.py was used to get the expected
output into a more reproducible state.
Change-Id: I1ca75c8e0c5778d25c1df531bd298007aac0ff4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
It's unexpected that all messages generated by the stream version
of qDebug and friends have a trailing space. It also makes switching
to categorized logging (which only supports the stream version) difficult,
since all autotests checking for debug output would have to be adapted.
Task-number: QTBUG-15256
Change-Id: I8d627a8379dc273d9689f5611184f03607b73823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When comparing expected with actual debug messages, allow the expected
ones to contain a trailing space. This is needed to not break all
autotests in a follow up patch, which will prevent ~QDebug() from
generating a trailing space by default.
Task-number: QTBUG-15256
Change-Id: I7f67393ddfbfe37fde1ca5ef45e4ad7f4b5324b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we
need to support windows phone in the target branch while it is not there
in the current stable branch (as of Qt 5.2).
Conflicts:
configure
qmake/generators/win32/msvc_nmake.cpp
src/3rdparty/angle/src/libEGL/Surface.cpp
src/angle/src/common/common.pri
src/corelib/global/qglobal.h
src/corelib/io/qstandardpaths.cpp
src/plugins/platforms/qnx/qqnxintegration.cpp
src/plugins/platforms/qnx/qqnxscreeneventhandler.h
src/plugins/platforms/xcb/qglxintegration.h
src/widgets/kernel/win.pri
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
tools/configure/configureapp.cpp
Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
New macro QVERIFY_EXCEPTION_THROWN may be used to check that some code
really throws an exception of specified type.
Change-Id: I7cf499c7c37a35407862bc604c6eb862c5f329d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Give processes a more complete environment (openSUSE
requires more variables to start an X11-process),
add test column indicating whether a test is
supposed to crash. If it is not, report crash reason.
Change-Id: I1e0ad59824963f69ee425f331d845741be2b3928
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Make it possible to match messages by a pattern.
Change-Id: I713312e86db5471755459f1ecc43e8f1ac7a95fb
Reviewed-by: Jason McDonald <macadder1@gmail.com>
- Remove irrelevant test subdirs via .pro files
- Follow WinCE codepaths where applicable
- Replace unsupported Win32 APIs with WinRT equivalents
This does not aim to fix any failures in the tests themselves; it only
makes them compile.
Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable
on Qt builds with no QProcess support. This commit does not change
QProcess-specific tests, which should be left out of the build using the
.pro file mechanism.
Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
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>
"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>
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>