⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Qt Creator: Auto test with custom executable

  • Hello everyone,
    We're getting started with the handy Qt Quick Test framework recently, but I got a little problem with the Qt Creator AutoTest interpreted feature.
    Since our application has some external runtime dependencies, the compiled programs (including the test stub) cannot be run directly in the output directory. Rather than the DESTDIR we run the executable in DLLDESTDIR, by adding custom executable in "Run settings".
    So far so good, but when I try to run tests in Qt Creator, it always use the default run configuration to run tests so that I can never get auto tests works with Qt Creator.
    Then I wonder is it possible to specify run configuration for a auto test project?
    Appreciate for any ideas!

    Environment: Windows 10 x64, Qt Creator 4.10.0

  • Lifetime Qt Champion


    Out of curiosity, why not do it the simpler way: modify the PATH environment of the Run part and add the paths to these third party libraries ?

  • Hi SGaist, thank you for the reply.
    Even though setting the PATH environment is a nice solution for most situation, but there're some other resource dependencies in our project which are base on the absolute path of the main executable.

  • Lifetime Qt Champion

    Can you give more details about that ?

  • For example that there's an dependency module(DLL) will use qApp->applicationDirPath() to make up paths to load fonts, images, add QML import paths, etc.

Log in to reply