[Development] Breaking QtQuickControls tests

Frederik Gladhorn frederik.gladhorn at theqtcompany.com
Mon Jun 1 10:33:22 CEST 2015


Hello,

this mailing list is about development of Qt itself, please use intereste at qt-
project.org for user questions. Unless you are writing a new Qt module that 
is... in which case more information would be appreciated.

Frederik

On Sunday, May 31, 2015 12:08:22 PM Van Looy Detlev wrote:
> Hello.
> 
> For a project I am doing I need a repository which has .qml tests, it seems
> that (from the Qt sources) QtQuickControls should fit my needs. When
> running tst_controls
> (/Qt5.4.1/5.4/Src/qtquickcontrols/tests/auto/controls), all 501 test cases
> pass.
> 
> What I want to do now is break (make fail) some of these test cases by
> changing some source .qml files in
> /Qt5.4.1/5.4/Src/qtquickcontrols/src/controls. So for example break
> tst_Slider.qml by changing some code from Slider.qml. However it seems no
> matter what I do to these source files, the tests always continue to pass
> unaffected.
> 
> After some examination I found that no calls are actually ever being made to
> these source files, but rather they are being made to
> /Qt5.4.1/5.4/gcc/qml/QtQuick/Controls.
> 
> So my question is: Is it possible to make these tests fail by changing the
> source files I mentioned? How are the source files used in the tests?

We try to embed most qml files into qrc, so that the tests are as portable as 
possible. You'll most likely have to build the test and depending on your 
setup run make install.

> 
> I have had some success by forcing the use of the source files, so for
> example changing:
> 
> from:
> var slider = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider { }',
> container, '');
> 
> to:
> var component = Qt.createComponent("../../../../src/controls/Slider.qml");
> var slider = component.createObject(container, {});
> 
> And I was planning on using this fix for every test case, however this does
> not work for certain cases. I am also unable to just use: var slider =
> Qt.createQmlObject('import QtQuick.Controls 1.2; import
> "../../../../src/controls/" Slider { }', container, '');
> 
> because this gives me errors:
> qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
> qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
> Qt.createQmlObject(): Component is not ready
> 
> If you can tell me what I am doing wrong in my createQmlObject statement,
> that would be helpful as well!
> 
> Regards,
> Detlev
> 
> PS: If anyone knows about any other (OS) projects which have an amount of
> .qml tests please let me know!




More information about the Development mailing list