Closed xzxzxc closed 1 year ago
In case you try to follow the following hint of the https://github.com/platformio/platformio-docs/blob/develop/advanced/unit-testing/frameworks/googletest.rst
::testing::InitGoogleTest(&argc, argv); // if you plan to use GMock, replace the line above with // ::testing::InitGoogleMock(&argc, argv);
and replace InitGoogleTest with InitGoogleMock, it will fail with an error:
InitGoogleTest
InitGoogleMock
error: no member named 'InitGoogleMock' in namespace 'testing'; did you mean 'InitGoogleTest'?
To fix it, you can add
#include "gmock/gmock.h"
at the beginning of the file.
I'm new to embedded programming and C++ at all, so it wasn't obvious to me, and took time to figure out. I hope the fix can help someone like me.
Thanks for the issue!
In case you try to follow the following hint of the https://github.com/platformio/platformio-docs/blob/develop/advanced/unit-testing/frameworks/googletest.rst
and replace
InitGoogleTest
withInitGoogleMock
, it will fail with an error:To fix it, you can add
at the beginning of the file.
I'm new to embedded programming and C++ at all, so it wasn't obvious to me, and took time to figure out. I hope the fix can help someone like me.