Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88831

Stop using #include <QtTest> in Qt tests

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.1.0 Alpha
    • Component/s: Testing: qtestlib
    • Labels:
      None
    • Commits:
      27d96b4789b98587e64642bf7bd6ef5f3a07e174 (qt/qtbase/dev)

      Description

      To use QtTest the correct include is QTest or QtTest/QTest.

      All other things being equal, it's NOT correct to use QtTest or QtTest/QtTest, as those are the module-wide includes, which recursively include all of QtCore  plus other files (e.g. QtGui stuff).

      There are as of now some 600+ occurences of QtTest inclusions in qtbase tests alone.

      1. Has anyone tried to do a mass search and replace and compare the build times?
      2. How about having the sanity bot automatically flag any usage of module-wide include?

        Attachments

        1. module-header-includes.txt
          125 kB
          Edward Welbourne
        2. module-includes.txt
          107 kB
          Edward Welbourne
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            david.skoland David Skoland
            Reporter:
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes