Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22668

Allow command line parameter for auto test runs

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • Qt Creator 4.10.0-rc1
    • Test Integration
    • None
    • All

    Description

      I have some small projects with auto tests directly integrated in the main program.

      They are started by passing "--test" as first parameter to main, which then delegates to QTest.

      int runTests(int argc, char *argv[])
      {
          tst_MyTest tc;
          const int result = QTest::qExec(&tc, argc, argv);
          return result;
      }
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          if (argc > 1 && qstrcmp(argv[1], "--test") == 0) {
              return runTests(argc - 1, &argv[1]);
          }
      
          MainWindow w;
          w.show();
      
          return a.exec();
      }
      

      The tests are recognized correctly by the auto test plugin, and the correct executable is started. However, due to the missing "--test" parameter, my tests are not run.

      If I could enter this parameter somewhere, then it should already work.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cstenger Christian Stenger
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes