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

CMake: custom target output parsing for MinGW doesn't generate error icons in code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • Qt Creator 3.5.1, Qt Creator 4.0.0-beta1
    • None
    • Windows 10, MinGW 4.9.2

    Description

      Given the following CMake project

      CMakeLists.txt
      cmake_minimum_required (VERSION 2.8)
      project (turtle-test)
      
      set (gtest_disable_pthreads on)
      
      add_subdirectory (googletest-master)
      config_compiler_and_linker()
      
      add_executable (${PROJECT_NAME} mock_turtle_test.cpp)
      target_link_libraries (${PROJECT_NAME} gtest gmock)
      
      add_custom_target(unittest ${PROJECT_NAME})
      
      mock_turtle_test.cpp
      #include <gmock/gmock.h>
      
      class Turtle
      {
      public:
          virtual ~Turtle() {};
          virtual void PenUp() = 0;
          virtual void PenDown() = 0;
          virtual void Forward(int distance) = 0;
          virtual void Turn(int degrees) = 0;
          virtual void GoTo(int x, int y) = 0;
          virtual int GetX() const = 0;
          virtual int GetY() const = 0;
      };
      
      class MockTurtle : public Turtle
      {
      public:
          MOCK_METHOD0(PenUp, void());
          MOCK_METHOD0(PenDown, void());
          MOCK_METHOD1(Forward, void(int distance));
          MOCK_METHOD1(Turn, void(int degrees));
          MOCK_METHOD2(GoTo, void(int x, int y));
          MOCK_CONST_METHOD0(GetX, int());
          MOCK_CONST_METHOD0(GetY, int());
      };
      
      class Painter
      {
          Turtle* turtle;
      public:
          Painter(Turtle* turtle) : turtle(turtle)
          {
          }
      
          bool DrawCircle(int x, int y, int)
          {
              turtle->GoTo(x, y);
              turtle->PenDown();
      
              return true;
          }
      };
      
      TEST(PainterTest, CanDrawSomething)
      {
          MockTurtle turtle;
      
          // Set expectations
          EXPECT_CALL(turtle, GoTo(100, 50));
          EXPECT_CALL(turtle, PenDown());
      
          // Call sequence
          Painter painter(&turtle);
      
          EXPECT_TRUE(painter.DrawCircle(101, 50, 10));
      }
      
      int main(int argc, char** argv)
      {
          testing::InitGoogleMock(&argc, argv);
          return RUN_ALL_TESTS();
      }
      

      googletest-master was taken from Google Test github master

      The failing test is highlighted in the output command line. But when the cm unittest is run in the Issues list the line is not marked with an error icon.

      I would have expected a red error icon at line 50 in mock_turtle_test.cpp

      Attachments

        1. gmock_mingw_fail.png
          82 kB
          Cristian Adam
        2. gmock_mingw_test2.png
          74 kB
          Cristian Adam

        Issue Links

          Activity

            People

              hunger Tobias Hunger
              cadam Cristian Adam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: