I am trying to write a function/method for my project, which will ask to user which all test cases are you going to run? It looks like below...,
Test_Cases_1
Finally I got some answer,
::test::GTEST_FLAG(list_tests) = true; //From your program, not w.r.t console.
If you would like to use --gtest_filter =*; /* =*, =xyz*... etc*/ // You need to use them in Console.
So, my requirement is to use them from the program not from the console.
Updated:-
Finally I got the answer for updating the same in from the program.
::testing::GTEST_FLAG(filter) = "*Counter*:*IsPrime*:*ListenersTest.DoesNotLeak*";//":-:*Counter*";
InitGoogleTest(&argc, argv);
RUN_ALL_TEST();
So, Thanks for all the answers.
You people are great.