Qt World Summit: Register Today!

TestCase - Test Driven Development (TDD) in QML

  • Creating a simple test case files to run with either qmlscene or Qt Creator.

    @>qmlscene test1.qml
    file:///x/d/qt/testDrivenQML/test1.qml:25 Type TestCase unavailable
    file:///Users/joshua/Qt5.2.0/5.2.0/clang_64/qml/QtTest/TestCase.qml:45 module "Qt.test.qtestroot" is not installed

    These instructions do not work (build error: 'QtGui/qwidget.h' file not found):
    and there is a very dated merge request referring to an OSX install issue.

    Is TDD for QML dead, or can this be made to work?


  • Hi,
    I get the same error but I haven't a solution.. I think you get this error for using


    Maybee this is a Bug...

  • I finally got around to solving this. You can't use qmlscene for TestCase testing. You can roll your own, but easier is to just use the qmltestrunner utility.

Log in to reply