Using Qt Quick Test with QBS



  • Looking at the Qt Quick Test example, I'm wondering how to implement the equivalent using QBS instead of qmake. I've gotten it down to needing QUICK_TEST_SOURCE_DIR to be defined somehow. Adding Depends { name: "Qt.qmltest" } to the Application item and using QUICK_TEST_MAIN(example), the application builds and runs. The problem is the macro is actually expanding to:

    int main(int argc, char **argv) \
    { 
        return quick_test_main(argc, argv, #name, 0); 
    }
    

    Since QUICK_TEST_SOURCE_DIR is not defined, meaning 0 is passed instead. This causes no tests to be run.

    With qmake, the pro file has "CONFIG += warn_on qmltestcase", but I'm not sure how to translate that into QBS. Specifically the qmltestcase part. Any ideas?



  • I use CMake, not QBS, but this should be similar.

    All you need to do in CMake is to link your test target to QuickTest module (exactly as you link Core, Gui etc modules)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.