googletest

Google Test: Parameterized tests which use an existing test fixture class?

I have a test fixture class which is currently used by many tests. #include <gtest/gtest.h> class MyFixtureTest : public ::testing::Test { void SetUp() { ... } }; I would like to create a parameterized test which also uses all that MyFixtureTest has to offer, without needing to change all my existing tests. How do I do that? I hav...

Convenient method in GoogleTest for a double comparison of not equal?

I'm looking for something similar to the ASSERT_EQ / ASSERT_NE for ASSERT_DOUBLE_EQ. Maybe I'm missing an easy way of doing this without having a ASSERT_DOUBLE_NE? ...

What are Google Test, Death Tests

I saw the documentation of that feature is seem pretty major since it's in Google Test overview features and detailed in: http://code.google.com/p/googletest/wiki/AdvancedGuide#Death_Tests They look like standard assert() but they're part of Google Test, so a xUnit testing framework. Therefor I wonder the real usage or advantage of usin...

How to catch an assert with google test?

Hello, I'm programming some unit test with google test framework. But I want to check is some asserts are well placed and are useful. So my question is: does exists a way to catch an assert in google test? Example: int factorial(int n){ assert(n >= 0); //.... } And then the test: #include <gtest/gtest.h> TEST(FactorialTest,...

How to capture stdout/stderr with googletest?

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 function in the tests, I want to assert that no output appears there. Or, maybe I want to test the error behaviour and want to assert that a ...

How can I build a googletest unit test using the gtest_main library with Jam?

I am trying to build a googletest unit test for a proof of concept as a new unit testing framework that we could possibly use. In googletest, there are two ways to write a unit test: with a main, or without a main. If you do not define a main, you can link in the gtest_main library, which includes a main() function for you, saving you ...

using googletest in eclipse: how?

I've downloaded google test, but now I've no idea on how to link it to my project in eclipse. Should I add it as a source folder? Should include it as g++ included library? And how can I run test then? ...