Commit Graph

132 Commits

Author SHA1 Message Date
Liang Qi 6e5251dd3d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/qml/qml/qqmltypeloader.cpp

Change-Id: If9874faf23e813b05ee4cf042133a528d73ba72a
2018-05-15 15:32:04 +02:00
Christoph Keller 6888f9b025 Fix TestCaseCollector fails to initialize component from resources
Change-Id: I9f1e20653776bbdf1a8a41a631636ec61ddd08b6
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-13 11:42:08 +00:00
Simon Hausmann 1a3447a040 Clean up manual reference of QQmlTypeData and QQmlPropertyCache
We have a few places in the type loader where we do adventurous manual
reference counting, where getType() returns a raw pointer that has been
addref()'ed and then sometimes somehow we call release() later. Commit
0b394e30bb is an example of where this can
easily go wrong. As a consequence and also in preparation for future
work on the type loader, this patch starts replacing the manual
reference counting there.

Changing the return type from QQmlTypeData *getType() to a
QQmlRefPointer<> itself is not sufficient though, as the implicit
operator T*() will still allow the caller to store the result as a raw
pointer. Therefore this patch removes the "unsafe" implicit extraction
operator.

As a result of that change, other types that are sometimes stored in
QQmlRefPointer are also affected and their usage needs to be adapted
to QQmlRefPointer usage or manual raw pointer extraction with .data().

Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-26 09:56:39 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Mitch Curtis c260d3062d Add QUICK_TEST_MAIN_WITH_SETUP to allow executing C++ before a QML test
This macro is the same as QUICK_TEST_MAIN, but takes the user's
QObject subclass as an argument, and calls pre-defined slots/invokable
functions on it, similar to how e.g. init() is called for C++ tests.

This allows e.g. context properties to be set for the QML tests.

By basing the API on invokable functions, we give ourselves the freedom
to easily add more functions in the future.

[ChangeLog][QtQuickTest] Added QUICK_TEST_MAIN_WITH_SETUP macro to
allow executing C++ before a QML test (such as registering context
properties).

Task-number: QTBUG-50064
Change-Id: Id566e388553811c220871248403d32545f8ae1eb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-02 07:37:18 +00:00
Jan Murawski 184c5470f5 Allow adding file selectors for QUICK_TEST_MAIN tests
This patch allows adding file selectors for QUICK_TEST_MAIN tests
via the command line switch "-file-selector". Adding such a
selector allows the test of platform specific QML components. E.g.
one can test an Android component on Linux.

Change-Id: I556ad7211ed4a0881150686270a9a4e69f68d1ee
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-12-05 10:42:24 +00:00
Lars Knoll 55a671ea73 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/qml/compiler/qv4compileddata.cpp
	src/qml/compiler/qv4compileddata_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4qmlcontext.cpp
	src/qml/jsruntime/qv4qmlcontext_p.h
	src/qml/jsruntime/qv4regexpobject.cpp
	src/qml/jsruntime/qv4regexpobject_p.h
	src/qml/types/qqmllistmodel.cpp
	src/quick/items/qquickanimatedimage_p.h
	src/quick/scenegraph/qsgrenderloop.cpp
	tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp

Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
2017-09-20 14:27:41 +02:00
J-P Nurmi 2aba6e35dc QuickTest: initialize import and plugin paths before TestCaseCollector
215c0145 broke QQC1 auto tests. The problem seems to be that
TestCaseCollector created a QQmlComponent instance before the import
and plugin paths were set. Later on, when running the actual tests,
a cached component was used and the paths were missing.

Task-number: QTBUG-63220
Change-Id: Ifec163899db9ea088fdabc179181cc150534fc4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-15 09:11:29 +00:00
Tor Arne Vestbø 215c0145be qmltest: Enumerate test cases / functions without evaluating QML
Most, if not all, QML tests are written without any sort of dynamic
instantiation of the test data, so doing view.setSource() will evaluate
the whole source file, compute bindings, create items, windows, etc.

This is less then ideal when all you want is to list the test functions
using -functions, or when running a single test from the command line,
as in both cases we'll still actually evaluate every single QML file.

This makes it really hard to evaluate test output, e.g. from the CI,
especially with logging enabled, as even if a single test is requested,
the logs are filled with results from the loading of the other tests.

To improve the situation we use a non-instantiated QML component that
we then inspect its compilation data, looking for test cases and
functions.

In the future the implementation of TestCase's qtest_run* machinery
should be built on top of QTestLib instead of being reimplemented in
JavaScript, but this is left for later.

Change-Id: Ie5448208daf786e335583ab6bdfbc195891ec1f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-13 14:40:52 +00:00
Tor Arne Vestbø be3559470a qmltest: Run each test in a separate QQuickView for test isolation
We don't want the individual tests to affect each other by what state
they leave the QQuickView (and corresponding QWindow and platform
window) in when they finish.

Task-number: QTBUG-62963
Change-Id: I90ad2364c8e9b769afc61eb762c4a604a567a856
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-09-05 10:38:24 +00:00
Eskil Abrahamsen Blomfeldt 43472c1e82 Fix finding test data on Android
The standard way of doing Qt Quick testing requires having
qml files available in the deployment somewhere in the
regular file system. This is not how Android works, where
all test data should be deployed as resources. To allow
this, we simply hardcode the test path as a resource path
on Android instead of checking on the disk.

Task-number: QTBUG-45576
Change-Id: I0729f5004a6206d2a10b782eb5b7d83a833c4f51
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-08-22 09:14:13 +00:00
Robin Burchell 55ba234990 quicktest: Don't warn if the root item has no size
It could be argued that all callers should be fixed, but this warning has
existed since 2012 and even our own tests do not all set sizes, so I think that
battle is a lost fight.

This helps make real problems with the tests more visible.

Change-Id: Ie29521695ef11943154dae40726d194dc72316c2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-12-22 10:24:43 +00:00
Lars Knoll e579076bb3 Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.

Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-29 10:10:27 +00:00
Anton Kudryavtsev d39d23b9f2 QmlTest: replace 'foreach' with 'range for'
And add QT_NO_FOREACH define to .pro file.
Now QmlTest is 'foreach' free.

Change-Id: I17d8563cafd34bb90fe455ae955da5c56fbd2899
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-11 18:34:37 +00:00
Anton Kudryavtsev 1be53f4e14 Use QStringRef to optimize memory allocation
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.

Create QString from QStringRef only where necessary.

While touching the code, also port loops to C++11 style.

Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-26 10:31:19 +00:00
Liang Qi 20a51e87fd Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	.qmake.conf

Change-Id: I356ec83cf687bd2833f9a7c5e820d56b1efa8979
2016-02-12 10:53:43 +01:00
Anton Kudryavtsev 151fd89616 QuickTest, QmlImportScanner: replace QStringLiteral with QLatin1String
... in string comparisons. It's more efficient.

Change-Id: Ia157618cf870870f24c4a2962a385962da819275
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-10 11:17:14 +00:00
Jani Heikkinen 45bd04ba73 Updated license headers
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)

Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-19 14:53:18 +00:00
Laszlo Agocs 3713120cc8 Indicate that QuickTestLib is running
QTestLib already sets this environment variable to indicate that
the code is running on a test environment. Do the same for QuickTest
too.

Change-Id: I597237fcd16dc568b750bdef325881e808c407eb
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-09 17:12:23 +00:00
Liang Qi 92dcf9e69e Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I54e66e992f5e5d441b8b5394e7a03ec5352e7bf3
2015-03-31 15:45:46 +02:00
Jason Erb 20f9ab60cf Improved QML test robustness and logging.
Added logging to quick_test_main and reordered for robustness
(e.g. moved "wait for load" to before error check).

Change-Id: Ifd48b5bdd1efee4301e5c4e571241762dca176ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-30 18:14:58 +00:00
Frederik Gladhorn ad67ec26d0 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	LICENSE.GPLv2
	examples/qml/networkaccessmanagerfactory/view.qml
	src/qml/jsruntime/qv4runtime.cpp
	src/qml/jsruntime/qv4stringobject.cpp

Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
2015-02-24 17:36:04 +01:00
Jani Heikkinen c5796292ad Update copyright headers
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.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Daiwei Li 81b876b717 qquicktest: Wait for the view to finish loading
Tests can be skipped if the view is still loading by the time we get
to the end of the loop. There is a case where the window is active
but the QML hasn't been loaded.

Change-Id: I4e8346ee547653810458d042925d673748c1fec8
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-02-03 02:04:40 +00:00
Alain Martin 7923f9f570 Add -plugins argument to qmltestrunner to specify plugins search path
Allow users to specify locations of compiled QML plugins.

Change-Id: I66059dc7b1314ca6fbef87032b16ccf3caf8bd30
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-17 20:54:40 +01:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Kai Koehne cf06b028f7 QtQuick test: Do not complain about Qt specific arguments
Commit 1ca5e82ccc caused a regression for Qt arguments like
-qmlsjsdebugger=xxx . These are automatically removed from argv by
QCoreApplication, but since we copied argv before instantiating
QCoreApplication this didn't have any effect.

Fix this by moving Q[Core]Application instantiation again before
the parsing and copying of testlib-specific arguments.

Task-number: QTBUG-37793
Change-Id: Ief41640b6cf3251f700a5d24d2e1141233a3888f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-04-03 13:54:29 +02:00
Friedemann Kleint 1ca5e82ccc QML testlib: Do not modify the arguments passed into QGuiApplication.
argc/argv passed  into QGuiApplication must match those
of main on Windows due to the special command line parsing.

Task-number: QTBUG-36466
Change-Id: Id722692d2bdc18a6627fdaeffb349b78137ae314
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-03-07 10:55:20 +01:00
Albert Astals Cid 05b6dc8d4d Make sure the test window has focus
Some setups like xvfb-run under Linux do not focus windows
after showing them, this means that any focus based test will
fail since the windows itself is unfocused. This makes sure
the test window will be shown and focused.

Change-Id: I1903b7cdf88b772e1ca15acd4899695b49615712
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-16 17:47:47 +01:00
Caroline Chao 1bcab3a747 qmltest: Add QTestDefinedVariables
QTestDefinedVariables is used by the QTestRootObject to check
is a preprocessor variable is defined.

Adding QT_OPENGL_ES_2_ANGLE. It can be useful to know
if it is defined (Win32 + Angle) while running a test.

Change-Id: I2f9ffb1028c94095c711ab64737b53b60c055312
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-08-28 20:22:24 +02:00
Caroline Chao 75a6f86f68 qmltest: Register test object as a singleton
Change-Id: I5f6c404ff2901082f22b953b29aed08d3488f31d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-08-28 20:22:18 +02:00
Sze Howe Koh 6597f05733 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

Qt3D       -> Qt 3D
QtLocation -> Qt Location
QtScript   -> Qt Script

Change-Id: Id59cb209e0e0407d564de0bfaab73990e64a02e6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-04-23 18:29:25 +02:00
Gunnar Sletta 36a42ed6b1 Merge branch 'release' into stable
Change-Id: I88ecd5f396ecd9a9c910108d1cca832a3087f1d8
2013-01-17 22:06:30 +01:00
Gunnar Sletta fc0e916784 Avoid race condition in QQuickTests
The QQuickView::show() function may or may not be synchronous and
because the rendering happens on another thread, the frameSwapped
can be emitted before we enter the qWaitForSignal() event loop.
Fix this by waiting for the window to become exposed instead, which
implies that it has rendered at least one frame.

Change-Id: I1100a6fe981018395bf141d67f06adb94a354206
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-17 15:31:04 +01:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Liang Qi 473ec17347 qmltest: Added the possibility to use QApplication
Current QML test cases in QtDesktopComponents still need to use
QApplication.

Added QT_QMLTEST_WITH_WIDGETS define when QtWidgets is available.
Also proveded a command line switch "-widgets" for it.

Change-Id: Ib6c7313538cb8875144636b6f8bd264b0f13aa8d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-12-31 21:13:04 +01:00
Shawn Rutledge 18f42ab9b5 Remove the remaining usages of deprecated QWindow accessors
Change-Id: I146e7b8e3ae0ee74f5f4e3ef85f59d50a639c0f5
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-30 15:20:52 +01:00
Tasuku Suzuki cedaf86742 Enable mobule build with QT_NO_TRANSLATION
Change-Id: Id7aeef0d499f48ddc64b4ea3e4dc713db8458c38
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
2012-11-26 18:47:20 +01:00
Shawn Rutledge eba5128f66 All QWindow properties that have "window" in them have been renamed.
Depends on patch Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 in qtbase.

Change-Id: I9614cc2c7ed119c663b3f6f99267483e291e529c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-08 19:04:56 +01:00
Friedemann Kleint 16a398f598 Fix crash in qtlocation tests.
Task-number: QTBUG-27696
Change-Id: I0cc12e1be25a789a8245fae3a444629ca57872ef
Reviewed-by: Christopher Adams <chris.adams@qinetic.com.au>
Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
2012-10-24 08:20:24 +02:00
Friedemann Kleint 7ccd053e63 Fix qmltest library.
- Avoid hangs (waiting for frameSwapped) and crashes
  in window managers for empty windows by giving windows
  a minimum size if they have 0x0 (observed on Mac, Windows).
- Polishing, set proper window flags, title, object name, output.

Change-Id: Iad5d66c3adbbfe085390132987e95f4c69272831
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
2012-10-20 09:05:03 +02:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Charles Yin 3e5d953239 Add waitForRendering() function for qmltest
Change-Id: I6357412d84fdb4a8b6bd8603baba7d10a2bcc245
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-07-25 04:09:33 +02:00
Charles Yin 4276def040 Align windowShown flag with qml renderer state
Previously, we set windowShown to true once the window is active,
this is not enough for some tests as the initial rendering may not
be finished yet and will give the wrong result for some tests which
require reading back pixels.

Change-Id: Idd67329d207aaf1734a795b40a5bcc40093cf6b8
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-06-14 02:44:19 +02:00
Donald Carr fe0a7b7166 Enabled widget free compilation of QtQuick
There is no hard dependency of QtQuick on QWidget. This change makes the
minor adjustments required to remove the build dependency altogether. This
patch follows the path of least resistance bypassing any elements with a
dependency on the legacy QWidget functionality.

Change-Id: Ie3f47d3b4f60a1460dbb5d76a494a2c329469cc0
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-04-18 21:39:59 +02:00
Charles Yin 0c86eaf006 Allocate QQuickView on heap instead of stack
Some qpa plugin will crash when delete the QApplication instance if
QQuickView is created on stack, this is a workaround fix, the real
reason still need to be investigated further.

Change-Id: Iea75541e53a94f65454e78f8020003e6533c0bd0
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 13:05:25 +02:00
Aaron McCarthy 340c479bb1 Only attempt to load QML test cases from source directory if it exists.
When running installed unit tests the QML test cases are likely not
in the source directory, but in the same directory as the installed
test binary.  If the source directory does not exist, fall back to
searching for QML test cases in the current directory.

Change-Id: I231b9cd49b12d88dd6cfbcc8dfb8b6c2c69d5aad
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-03-13 05:13:50 +01:00
Charles Yin 5f018216f6 Remove the rest of qtquick 1.0 code from qmltest
Change-Id: I0d20583faf1a75f287dcd866b11457254d250354
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-13 02:02:49 +01:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported
by the quick1 module.

Users can apply the bin/rename-qtdeclarative-symbols.sh
script to modify client code using the previous names of the
renamed symbols.

Task-number: QTBUG-23737
Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-24 04:51:31 +01:00
Caroline Chao 5b3d57e8f8 CodeCoverage: Fixes regression.
Fixes segmentation fault introduced by qtbase change:
36f5cc848de2525

Coverage data are now saved in QTestLog::stopLogging. Also the current
application name needs to be set for a quick test as well.

Remove also code coverage call to installCodeCoverage from quicktest
due to refactor of the code coverage setup in qtestlib. This should be less
error-prone. See qtbase change:
949b7452e0d2402

Change-Id: I13566cc43dfb3af264d3b2be2e5f2617128f4801
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-02-22 11:59:23 +01:00
Friedemann Kleint fbddf793e9 QtDeclarative/Quick: Fix warnings.
Change-Id: I71bd638fcc41356e0b76df27ec76ad3ed5ef90d9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-02-16 08:31:17 +01:00
Jason McDonald 5572b4c9ed qmltest: Count passes, fails and skips consistently.
This commit changes qmltest to count one pass per data row, rather than
a single pass for an entire data-driven test function.  This makes
counting of passes consistent with counting of fails and skips which
were already counted once per data row.  This change also means that the
plain-text, xml and light-xml output formats will now show one result
per data row, so that every data row executed will be shown in the test
output with either a pass, fail or skip result.  Previously data rows
that passed were not shown in the output, preventing analysis of total
number of tests runs, pass-rates, and various other metrics.

This commit corresponds to (and depends on) a commit in the qtbase
module which changes the behaviour of qtestlib in the same way.

Task-number: QTBUG-21848
Task-number: QTBUG-22124
Change-Id: I3c1f0e68bdff4087b9ccfc80a3f96f4541335b6f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-13 04:20:25 +01:00
Jason McDonald 3233e8052d Remove code related to test location.
Testlib no longer does anything with the test location and neither do
any of Qt's tests, so this code is no longer needed.

Change-Id: Ic370b6b741382a90454c893bffcab4a7328a2f9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-09 06:29:37 +01:00
Jason McDonald e8420af071 qmltest: Perform extra checks after each data row is executed.
Add calls to the new function QTestResult::finishedCurrentTestData() to
verify that expected failures and expected messages have been produced.

Change-Id: Ia139a962c705a5f47be992b7f2e81775aa2e2f28
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-09 00:31:00 +01:00
Caroline Chao 9df2da5b9f CodeCoverage: Fix wrong type passed to saveCoverageTool.
Passing a bool as appropriate.

Change-Id: I0dcca8d30c6d75e7fcddcf7047e1dd1c572ec6ea
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-08 15:03:25 +01:00
Matthew Vogt 01dc7e2ea4 Remove QtQuick1 elements from qtdeclarative
QtQuick1 is now contained in a separate repository.

Task-number: QTBUG-23737
Change-Id: I09eae67af5693a22b896b916f816f73ccc3a89b1
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-03 00:39:18 +01:00
Jason McDonald 45b14259fc Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 23:52:43 +01:00
Jason McDonald e6b224aa28 Update obsolete contact address.
Replace Nokia contact email address with Qt Project website.

Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-01-23 06:28:53 +01:00
Jason McDonald 5180186da2 Update copyright year in Nokia copyright headers.
Update copyright headers from before 2011, and a couple of new ones that
were merged after the previous change to copyright headers.

Change-Id: Ia76e08e2734afa4ef3f1207dbcda5ff3bc81b366
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-17 06:45:52 +01:00
Charles Yin d9ecb7345c Don't delete global app
Sometimes delete the global GUI app causes crash, this is a work around
fix.

Change-Id: Ic2406e7a085483de5d96321de8257663925b7e5e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-01-13 06:45:10 +01:00
Friedemann Kleint 424d30275c QMLTest: Fix output of file names, make output more verbose.
- Check command line arguments thoroughly.
- Change all QuickTestResult functions taking file names to
  accept QUrls and format them using QUrl::toLocalFile() in case
  of local file names in order to display Windows drive
  letters correctly.
- Introduce a template function (for QDeclarativeView, QQuickView)
  that dumps out all available information when compilation goes
  wrong.
- Skip 'Debug', 'Release' folders for Windows builds.

Change-Id: Ibdd92867870a2b05494de8a0adbe0910d4897ba2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-01-11 14:25:00 +01:00
Caroline Chao 5456784005 Integrate testcocoon support into QtQuickTest.
Add support to install and save coverage data when a test is run
using quick_test_main.

Change-Id: I39ddd678d748979c335139b3f8bda43b3d05720d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-09 13:08:36 +01:00
Kent Hansen 6c8378eaf1 Say hello to QtQuick module
This change moves the QtQuick 2 types and C++ API (including
SceneGraph) to a new module (AKA library), QtQuick.

99% of this change is moving files from src/declarative to
src/quick, and from tests/auto/declarative to
tests/auto/qtquick2.

The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to
a plugin, src/imports/qtquick2, just like it's done for QtQuick 1.

All tools, examples, and tests that use QtQuick C++ API have gotten
"QT += quick" or "QT += quick-private" added to their .pro file.

A few additional internal QtDeclarative classes had to be exported
(via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the
QtQuick 2 implementation.

The old header locations (e.g. QtDeclarative/qquickitem.h) will
still be supported for some time, but will produce compile-time
warnings. (To avoid the QtQuick implementation using the
compatibility headers (since QtDeclarative's includepath comes
first), a few include statements were modified, e.g. from
"#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".)

There's a change in qtbase that automatically adds QtQuick to the
module list if QtDeclarative is used. Together with the compatibility
headers, this should help reduce the migration pain for existing
projects.

In theory, simply getting an existing QtDeclarative-based project
to compile and link shouldn't require any changes for now -- but
porting to the new scheme is of course recommended, and will
eventually become mandatory.

Task-number: QTBUG-22889
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-12-02 14:18:20 +01:00
Charles Yin 4b49a7ab1f Fix qmltestrunner crash bug when report filename and line number
The HandleScpe is not needed here. Also for each test file, the rootObj
should reset its internal states properly, otherwise the following test
cases are polluted by the previous tests.

Task-number:QTBUG-22620
Change-Id: I1e4869070b8712e5a6c755461d52bd12d1f03160
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2011-11-09 11:29:42 +01:00
Friedemann Kleint c29b3c0974 Declarative: Fix gcc 4.6 warnings about assigned/unused variables.
Change-Id: Iac4bb4a6b1aa4071a239bb25f25f01b71e36868b
Reviewed-by: Alexis Menard <alexis.menard@openbossa.org>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-11-01 11:52:03 +01:00
Charles Yin 0339d34691 Add I18N support to qmltestrunner
Add a new command line option "-translation file" to handle translation
files to qmltestrunner.

Task-number:QTBUG-22390
Change-Id: I351ed41734c79a51e00aeef551af642482bf36f2
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2011-10-28 22:31:56 +02:00
Charles Yin ec0402116c Fix qmltestrunner hang bug when no TestCase item
Add a hasTestCase property to the global qtest object, set it to true
in each TestCase's onCompleted handler. qmltestrunner only enter the
event loop if this property is true to avoid infinite waiting.

Task-number:QTBUG-22281
Change-Id: Id609432210ae795d8c128901e64ba0aef4551f01
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
2011-10-24 03:02:19 +02:00
Kent Hansen bfb3c424ab Rename Qt Quick-specific classes to QQuick*
The QSG (SceneGraph) prefix is too generic for
Qt Quick(2)-specific classes.

All the classes and files in the declarative/items
directory have been renamed.

In particular, for classes that are currently public,
the renaming is as follows:

QSGView --> QQuickView
QSGCanvas --> QQuickCanvas
QSGItem --> QQuickItem
QSGPaintedItem --> QQuickPaintedItem

The header files have been renamed accordingly
(e.g. qsgview.h --> qquickview.h).

Change-Id: Iac937fff81db20bb639486a793c3aeb5230b038c
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-21 11:53:26 +02:00
Charles Yin 8cbd59e253 only use one QSGView instance for all qml test cases
Change-Id: I9296e30d216b57d8cf2a11e94030781f03594aa6
Reviewed-on: http://codereview.qt-project.org/6646
Reviewed-by: Charles Yin <charles.yin@nokia.com>
2011-10-14 05:08:43 +02:00
Charles Yin 08d8fe791b make it possible to run single qml test case file by passing a tst_*.qml file to -input option
Change-Id: I8376ca0ae23d4366d69e0e7f3c95593ba54fc71d
Reviewed-on: http://codereview.qt-project.org/6273
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
2011-10-10 05:47:52 +02:00
Matthew Cattell d93cc35d4f make quicktest build and modify to use qwindow
Change-Id: Idebb00b828307421bcbd89d8abaa9ea1d903af47
Reviewed-on: http://codereview.qt-project.org/4542
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-09-09 15:00:47 +02:00
Gunnar Sletta 7147835237 Merge branch 'master' into refactor
Conflicts:
	src/3rdparty/v8
	src/declarative/declarative.pro
	src/declarative/items/qsgcanvas.cpp
	src/declarative/items/qsgshadereffectsource_p.h
	src/declarative/items/qsgview.cpp
	src/declarative/particles/qsgcustomparticle.cpp
	src/imports/gestures/gestures.pro
	src/imports/particles/particles.pro
	src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
	src/qtquick1/qtquick1.pro
	tests/auto/declarative/examples/examples.pro
	tests/auto/declarative/qsglistview/qsglistview.pro
	tests/auto/qtquick1/qdeclarativeviewer/qdeclarativeviewer.pro

Change-Id: I423344f83e1835116cad531b877fde6e68a8849a
2011-08-31 08:55:16 +02:00
Samuel Rødal 957c8fb994 Get declarative running on new gui/opengl stack.
Rename QGuiGLContext -> QOpenGLContext, QGL* -> QOpenGL*, etc.

Change-Id: I08379029d756e28b20ae141ca30ed801626b513d
Reviewed-on: http://codereview.qt.nokia.com/3711
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-08-29 10:25:51 +02:00
Kai Koehne 33ecffd4e2 Deprecate QDeclarativeDebugHelper class
This was a helper class for enable debugging in 4.7. Since Qt 4.8 you
should just say CONFIG += declarative_debug

Change-Id: I51dabaec36e175a097721570061aad38c3f828d1
Reviewed-on: http://codereview.qt.nokia.com/3507
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-08-26 12:13:45 +02:00
Charles Yin 12aae0aab3 parse args earlier
Change-Id: Ie0869d3f70d1e898a9b0635e28bcad2e92fa607c
Reviewed-on: http://codereview.qt.nokia.com/2718
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>
2011-08-08 03:37:54 +02:00
Charles Yin 16fc17f9eb don't create QApplication if there is already one there
Change-Id: Iaf9ebf6855992962abfb3452dc398149af15bbbc
Reviewed-on: http://codereview.qt.nokia.com/2711
Reviewed-by: Charles Yin <charles.yin@nokia.com>
2011-08-08 02:13:20 +02:00
Simon Hausmann d410ad364e Merge the QJSEngine and QJSValue development branch into master.
This replaces the dependency to QtScript with two new builtin classes
QJSValue and QJSEngine.

This is still work in progress, development continues now in the master branch.

Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de
Reviewed-on: http://codereview.qt.nokia.com/2299
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2011-07-29 13:00:52 +02:00
Martin Jones 4442dea01b Extract all QtQuick 1 elements into a separate library/plugin.
Change-Id: I41a280de2739ee08202f4be2519e5012870090f2
Reviewed-on: http://codereview.qt.nokia.com/1391
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-07-12 06:38:09 +02:00
Aaron Kennedy 26590325b5 Merge branch 'v8'
Conflicts:
	src/declarative/qml/qdeclarativescarceresourcescriptclass.cpp
	src/declarative/qml/qdeclarativescarceresourcescriptclass_p.h

Change-Id: I54e579307cbeafbbad21884218c5e797ba245c8b
2011-07-08 15:56:48 +10:00
Jyri Tahtela 5a705d8951 Update licenseheader text in source files for qtdeclarative Qt module
Replace old license header with correct one.

Change-Id: I492ddaaa0227b2c8faf11bdcd6e12e7231a54a10
Reviewed-on: http://codereview.qt.nokia.com/1312
Reviewed-by: Jyri Tahtela <jyri.tahtela@nokia.com>
2011-07-08 02:45:03 +02:00
Charles Yin 9ebf3d12a1 get the caller file & line number from v8 stack trace.
Change-Id: I0ffebd2d22702bc14e1629b8bc0455a9cf8ea416
2011-06-23 11:39:56 +10:00
Charles Yin daf671b422 Integrate QtQuickTest into Qt
Change-Id: I558821c0dec9166ea1d0d2e1e2f889553c436316
Task-number:QTBUG-16082
2011-05-20 12:07:23 +10:00