How can I pass parameter to my test suites?
gtest --number-of-input=5
I have the following main gtest code. And --number-of-input=5
Google Test only recognizes its own command-line options. Each time it finds one, it removes it from argv
and updates argc
accordingly, so after InitGoogleTest
returns, anything left over in argv
is available for you to process yourself. Use your favorite command-line-parsing technique, store the results in some global variable, and refer to it during your tests.
If a command-line options looks like a Google Test option but really isn't, then the program will print its help message and exit without running any tests. Google Test options start with gtest_
.