usually you pass all command line arguments to gtest for the --gtest_*
arguments with something like
testing::InitGoogleTest(&argc, argv);
Nothing prevents you from passing other than the original arguments.
Here is a un-tested example code:
int main(int argc, char** argv) {
const char* data_path = NULL;
char** gtest_argv = malloc(sizeof(char*) * argc);
gtest_argv[0] = argv[0]; // simply copy first argument
int gtest_argc = 1;
for (int i = 1; < argc; i++) {
if (strcmp(argv[i], "data_path") != 0) {
gtest_argv[gtest_argc++] = argv[i];
} else {
data_path = argv[i];
}
}
testing::InitGoogleTest(>est_argc, gtest_argv);
free(gtest_argv);
Here is a stackoverflow question about the same problem:
http://stackoverflow.com/questions/4818785/how-to-pass-parameters-to-the-gtest
I hope this helps.
Dirk