About 1,300,000 results
Open links in new tab
  1. How to start working with GTest and CMake - Stack Overflow

    Dec 15, 2011 · I have recently been sold on using CMake for compiling my C++ projects, and would now like to start writing some unit tests for my code. I have decided to use the Google …

  2. How do I build and use googletest (gtest) and googlemock …

    May 4, 2022 · Googletest (gtest) seems to be an immensely popular unit test framework and I'd like to learn how to build it stand-alone on the g++ compiler, simply and easily, so I can test …

  3. c++ - GoogleTest: How to skip a test? - Stack Overflow

    Aug 26, 2011 · I recommend using GTEST_SKIP () or GTEST_SKIP_ ("<message>") to exit after runtime environment checks that you have to "live with", so the skipping is separately logged …

  4. How to run specific test cases in GoogleTest - Stack Overflow

    Aug 22, 2012 · You could use advanced options to run Google tests. To run only some unit tests you could use --gtest_filter=Test_Cases1* command line option with value that accepts the * …

  5. c++ - How to pass parameters to the gtest - Stack Overflow

    Jun 9, 2015 · Use your favorite command-line-parsing technique, store the results in some global variable, and refer to it during your tests. If a command-line options looks like a Google Test …

  6. c++ - How to run gtest? - Stack Overflow

    May 18, 2020 · #include "gtest/gtest.h" #include "gmock/gmock.h" TEST(TrivialTest, Negative) { ASSERT_EQ(0, 1); } I'm stuck here, how should I run this test? If I put the following code in …

  7. How to capture stdout/stderr with googletest? - Stack Overflow

    Is it possible to capture the stdout and stderr when using the googletest framework? For example, I would like to call a function that writes errors to the console (stderr). Now, when calling the

  8. How to set GoogleTest variables GTEST_LIBRARY …

    Sep 23, 2015 · If GTest is installed correctly (include files + libraries), these variables should be set by find_package(GTest) call. Check you GTest installation, and check whether it contains …

  9. What's the difference between gtest.lib and gtest_main.lib?

    The gtest library (variously called gtest.a, gtest.so, gtest.lib or libgtest.a, etc, depending on your platform and whether you are using the shared library) contains the object code for the gtest …

  10. How to get code coverage for google-test unit tests

    Mar 1, 2010 · Is it possible to get code coverage done by tests using google test (GTest) framework?