googletest Questions

2

I'm trying out gtest for C++ (Google's unit testing framework), and I've created a ::testing::Environment subclass to initialize and keep track of some things that I need for most of my tests (and ...
Upcountry asked 12/3, 2010 at 19:32

1

Solved

I can add via visual studio 2017 a googletest project to my solution. When I do this, it generates automatically a new project with a sample test. And adds a nuget package of Microsoft.googlete...

2

So, I know there's "literally" fixtures for gtest, but the constructor/destructor and setup/teardown functions will execute after each test rather than after the entire set of tests in the fixture....
Mccreery asked 5/12, 2014 at 18:27

8

Solved

Using Google Test 1.6 (Windows 7, Visual Studio C++). How can I turn off a given test? (aka how can I prevent a test from running). Is there anything I can do besides commenting out the whole test?...
Connected asked 26/8, 2011 at 16:55

1

Is there a way to disable automatic capturing of C++ exceptions when running unittests with Google test? This in order to get better context of the origin of an error.
Slider asked 14/10, 2018 at 11:32

2

I'm comparing GoogleMock vs FakeIt for writing unit tests. I like FakeIt over GoogleMock because I'm from Java background and FakeIt sticks close to Mockito/JMock syntax which make using the librar...
Inositol asked 10/11, 2015 at 21:3

1

Solved

I have fallowing sets of tests: TEST_F(FactoryShould, createAFromAModule) { const auto stateMachine = createStateMachine(EModule_A); const auto* typedStateMachine = dynamic_cast<const BackEn...
Abstemious asked 10/9, 2018 at 11:36

2

I try to implement uni tests for our C++ legacy code base. I read through Michael Feathers "Working effectively with legacy code" and got some idea how to achieve my goal. I use GooleTest/GooleMock...
Fitzpatrick asked 3/9, 2018 at 15:30

4

I would like to create two executables: one executable for the application, and one for the testing of the application. To that end, I have the following in my CMakeLists.txt file: include_directo...
Lanita asked 23/1, 2017 at 17:1

3

I am using Linux machine. I have download the googletest package from here However, there is no installation guide or other blogs related on how to set it up properly The README file is no good th...
Amparoampelopsis asked 5/1, 2012 at 8:17

1

Solved

NOTE it's not a duplicate of this question or this question. How to build Googletest from source using g++ into a shared library (.so)? I tried the steps described in Google Test's document on...
Monospermous asked 13/8, 2018 at 5:28

3

Solved

I'm using CMake for a project and googletest for my test cases. Looking around the internet, it seems to be common practise to just copy the googletest source into a subfolder of your repository an...
Vacuum asked 11/2, 2016 at 16:1

2

All test cases that somehow include <gtest/gtest.h> and <google/dense_hash_map> fail to build for me. Usually the later is included indirectly but I can reproduce the problem like this:...
Diactinic asked 15/9, 2016 at 15:57

3

I want to find GTest via: find_package(GTest REQUIRED) But it is not found: Error:Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) I know from this link th...
Scald asked 20/10, 2016 at 7:49

1

Solved

I'm trying to do something that I feel should be simple to do, but I can't figure out how. Basically I have a Jenkins master (running on Linux) and two slaves, one on Windows and the other on macO...

1

Solved

This is NOT a duplicate of Superiority of unnamed namespace over static? Please read the question carefully before marking it as duplicate. I am not asking why use an unnamed namespace versus stati...
Gefell asked 18/12, 2017 at 2:49

3

Solved

I have an unit test which tests some code that is multi-threaded. While I was writing this code I used the following command many times bazel test //xyz:my_test --runs_per_test 1000 This exposed...
Reminisce asked 15/6, 2018 at 14:47

2

Solved

I'm more familiar with the google test framework and know about the primary behavior pair they support about ASSERT_* vs EXPECT_* which are the fatal and non-fatal assert modes. From the documenta...
Pudendas asked 31/5, 2018 at 18:44

1

Solved

Let's assume that there is Bar object which uses a Foo object. The ownership is exclusive, so Bar gets Foo as a std::unique_ptr in its constructor. I would like to test Bar with Google Test framewo...
Terpsichorean asked 23/5, 2018 at 18:54

2

I'm testing a particular implementation of a algorithm with random input data using google test framework. I want to use the same random input data for another implementation of the same algorithm....
Micah asked 5/8, 2016 at 18:33

1

Solved

In Google test framework to assert two doubles are equal we can use: ASSERT_DOUBLE_EQ(val1, val2); instead of ASSERT_EQ(val1, val2); To avoid precision issues. To compare the elements of a v...
Selfsupport asked 1/4, 2018 at 15:41

1

When i try to build googletest (and googlemock) 1.8.0 i get an undefined reference to MakeAndRegisterTestInfo when i try to link with libgtest.a. It works fine with version 1.7.0 with the same cmak...
Alburg asked 29/8, 2016 at 13:49

2

Solved

I tried to use gtest installed through conan, but ended up with an undefined reference linker error. This question is a more or less a follow up to this stackoverflow question. But I think the prov...
Weimaraner asked 10/2, 2017 at 14:40

3

When instantiate test using INSTANTIATE_TEST_CASE_P according to tuple params Each test have suffix that by default running number from zero How I can force to have sense suffix ? How to override...
Holtz asked 3/9, 2017 at 12:19

2

Solved

In Mockito we can specify multiple returns like (taken from here): //you can set different behavior for consecutive method calls. //Last stubbing (e.g: thenReturn("foo")) determines the behavior ...
Ouster asked 26/10, 2015 at 20:49

© 2022 - 2024 — McMap. All rights reserved.