I am following this tutorial, but I dont entirely understand how the TEST functions are executed
https://www.bogotobogo.com/cplusplus/google_unit_test_gtest.php
The example code is here:
#include "gtest/gtest.h"
#include "simplemath.h"
TEST(testMath, myCubeTest)
{
EXPECT_EQ(1000, cubic(10));
}
Does the TEST
function get called automatically by the API?
What if there are multiple TEST
functions?
I have some external code which has multiple TEST
functions and I need to call them from another executable outside of GTest. I was able to include the project, but cannot figure out how to call the TEST
functions.
Is there any way that I can call TEST
manually from another piece of code?
I see that TEST
is defined as GTEST_TEST
in gtest.h
But I don't see where GTEST_TEST
is defined.
Where is the main
function? Is it somewhere in gtest
api?
Thanks,