I'm writing unit tests for a c++ project using Visual Studio, Test Explorer, and google test. I have two classes to test 'Strategy' and 'StockThread'. If I declare my class of type Strategy, none of the test cases are discovered by Test Explorer and I can't run any of them. Moreover, I don't see any output to help debug the problem.
If instead, I declare a class of type "StockThread", the tests are discovered as intended. The project being tested compiles and runs on its own, and the "Strategy" class is the first class declared.
The Test Explorer shows the problematic behavior.
If I comment out the line and change it to declare a StockThread, it's able to run.
Here is the code that produces the issue
TEST(TestStrategy, TestStrategyDeclaration)
{
//This other class, if declared instead, runs properly
//StockThread st;
//**declaring objects of type Strategy causes all the test cases to disappear
Strategy* strat = new Strategy();
EXPECT_TRUE(true);
}
When I compile with Strategy commented or uncommented, I get the following:
Build started...
1>------ Build started: Project: GoogleUnitTesting, Configuration: Release Win32 ------
1>unittest.cpp
1>C:\Eclipse-workspace\TWS API\source\CppClient\client\platformspecific.h(16,1): warning C4005: 'assert': macro redefinition
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\assert.h(26): message : see previous definition of 'assert'
1>GoogleUnitTesting.vcxproj -> C:\Eclipse-workspace\TWS API\samples\Cpp\AcceleratedInvesting\Release\GoogleUnitTesting.exe
1>Done building project "GoogleUnitTesting.vcxproj".
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Is there a way to see the output of the tool running discover tests so I can see why it doesn't find the tests?