Open Mr-Leshiy opened 3 years ago
Hi @Mr-Leshiy, I searched for that function in GoogleTest's source code and found it in googletest/include/gtest/internal/gtest-port.h
:
// Defines synchronization primitives.
#if GTEST_IS_THREADSAFE
# if GTEST_HAS_PTHREAD
// Sleeps for (roughly) n milliseconds. This function is only for testing
// Google Test's own constructs. Don't use it in user tests, either
// directly or indirectly.
inline void SleepMilliseconds(int n) {
const timespec time = {
0, // 0 seconds.
n * 1000L * 1000L, // And n ms.
};
nanosleep(&time, nullptr);
}
# endif // GTEST_HAS_PTHREAD
It looks like you're trying to use a GTEST-internal function within your test suite. If you just want to make gtest wait, maybe this thread from stackoverflow can help.
@Schallbert , I am just trying to build the original googletest project, it is not about that I have problems with the usage of the gtest in my own projects.
@Mr-Leshiy, thanks for the clarification.
To further track things down: did you install the pthtead
library? When I tried to build with MinGW in the past and didn't have this package installed, it would fail for a similar reason. Refer to this post on my website to see the prerequisites for googletest when it comes to installed libraries.
Hello, I'm not sure if it will be accepted But, this https://github.com/google/googletest/pull/3482 seems to solve the above issue
Can I ask why are you building this with -Dgtest_disable_pthreads=ON
?
@derekmauro , I am was trying to build gtest with all tests and was trying different combinations of build. It is not something that I use in the project.
Describe the bug
I have got a compilation error
Steps to reproduce the bug
Build project with the following lines
What build system are you using?