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

GTest test does not appear in "Tests" sidebar

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.10.2, Qt Creator 4.11.2, Qt Creator 4.12.4, Qt Creator 4.13.3, Qt Creator 4.14.1, Qt Creator 4.15.0-beta1
    • Fix Version/s: Qt Creator 4.15.0-rc1
    • Labels:
      None
    • Environment:
      Any
    • Platform/s:
      All
    • Commits:
      5d5ff574953822043619c23f9b251016ac3357fe

      Description

      When test case starts with a number, test case does not appear in tests output pane:

      Minimum example:

      #include <gtest/gtest.h>
      #include <gmock/gmock-matchers.h>

      using namespace testing;

      class foo : public ::testing::Test
      {
      protected:
      void SetUp() override {}
      void TearDown() override {}
      };

      TEST_F(foo, 1bar)

      { EXPECT_EQ(1, 1); ASSERT_THAT(0, Eq(0)); }

       

      I have been looking in QtCreator code to see what is wrong, but I got stuck, and I do not know how to continue. It appears that in gtestvisitor.cc on line 48 is checking if symbol argumentCount() is 2. Seems like TEST_F is parsed here as function, and seems like this code checks that this function has 2 arguments. However, since this is not function, I am guessing that during parse its arguments get discarded because one of them starts with number, and argumentCount() on line 48 returns 0, so gtestvisitor skips the test case, and does not put it in "Tests" sidebar.

       

        Attachments

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

          Activity

            People

            Assignee:
            cstenger Christian Stenger
            Reporter:
            pperisin Petar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes