CMake cannot find GoogleTest required library in Ubuntu

Google test was probably not properly installed (libgtest-dev may install only source files that needed to be compiled). I had the same problem and I followed the instructions from http://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/ sudo apt-get install libgtest-dev sudo apt-get install cmake # install cmake cd /usr/src/gtest sudo cmake CMakeLists.txt sudo make #copy or symlink libgtest.a and libgtest_main.a to … Read more

How to pass parameters to the gtest

Google Test only recognizes its own command-line options. Each time it finds one, it removes it from argv and updates argc accordingly, so after InitGoogleTest returns, anything left over in argv is available for you to process yourself. Use your favorite command-line-parsing technique, store the results in some global variable, and refer to it during … Read more

What’s the difference between gtest.lib and gtest_main.lib?

the only reasonable difference is that gtest_main.lib provides a default implementation of a test application entry point (i.e. main function): Citation from Getting started with Google C++ Testing Framework: “[…] maybe you think that writing all those main() functions is too much work? We agree with you completely and that’s why Google Test provides a … Read more

SEH exception with code 0xc0000005 thrown in the test body

A SEH (Structured Exception Handling) exception is not a C++-exception that can be handled using c++-language constructs (try-catch) but it is raised from windows itself and points to some fundamental flaw. SEH-exceptions are very annoying because they do not cause normal stack unwinding which can lead to unclosed files or not-unlocked mutexes that should normally … Read more

Google Test: Is there a way to combine a test which is both type parameterized and value parameterized?

There isn’t any ready-to-wear combination of type-parameterized tests and value-parameterized tests. The googletest developers have been asked the question and they said No. However, there is a routine and simple way (as suggested by Zhanyong Wan in the linked discussion) in which you can craft you own type-parameterised test case that tests some condition for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)