Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 3.5.1, Qt Creator 4.0.0-beta1
-
None
-
Windows 10, Visual C++ 2013
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 is empty!
I would have expected a red error icon at line 50 in mock_turtle_test.cpp and the issues list populated with the errors.
See QTCREATORBUG-15505 for a similar issue with MinGW.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-15505 CMake: custom target output parsing for MinGW doesn't generate error icons in code
- Closed