Lines Matching defs:args
846 static void AddPathSeparatorInTestProgramPath(std::vector<char*>& args) {
852 if (strchr(args[0], '/') == NULL) {
860 args[0] = strdup(path);
864 static void AddGtestFilterSynonym(std::vector<char*>& args) {
866 for (size_t i = 1; i < args.size(); ++i) {
867 if (strncmp(args[i], "--gtest-filter", strlen("--gtest-filter")) == 0) {
868 args[i][7] = '_';
884 // Pick options not for gtest: There are two parts in args, one part is used in isolation test mode
887 // part in args.
889 // args is used to pass in all command arguments, and pass out only the part of options for gtest.
892 static bool PickOptions(std::vector<char*>& args, IsolationTestOptions& options) {
893 for (size_t i = 1; i < args.size(); ++i) {
894 if (strcmp(args[i], "--help") == 0 || strcmp(args[i], "-h") == 0) {
901 AddPathSeparatorInTestProgramPath(args);
902 AddGtestFilterSynonym(args);
906 for (size_t i = 1; i < args.size(); ++i) {
907 if (strcmp(args[i], "--bionic-selftest") == 0) {
914 for (size_t i = args.size() - 1; i >= 1; --i) {
915 if (strncmp(args[i], "--gtest_filter=", strlen("--gtest_filter=")) == 0) {
916 gtest_filter_str = std::string(args[i]);
917 args.erase(args.begin() + i);
922 args.push_back(strdup("--gtest_filter=bionic_selftest*"));
934 args.push_back(strdup(gtest_filter_str.c_str()));
939 for (size_t i = 1; i < args.size(); ++i) {
940 if (strcmp(args[i], "--no-isolate") == 0) {
942 } else if (strcmp(args[i], "--gtest_list_tests") == 0) {
962 for (size_t i = 1; i < args.size(); ++i) {
963 if (strncmp(args[i], "-j", strlen("-j")) == 0) {
964 char* p = args[i] + strlen("-j");
969 } else if (args.size() > i + 1) {
971 count = atoi(args[i + 1]);
979 } else if (strncmp(args[i], "--deadline=", strlen("--deadline=")) == 0) {
980 int time_ms = atoi(args[i] + strlen("--deadline="));
986 } else if (strncmp(args[i], "--warnline=", strlen("--warnline=")) == 0) {
987 int time_ms = atoi(args[i] + strlen("--warnline="));
993 } else if (strncmp(args[i], "--gtest_color=", strlen("--gtest_color=")) == 0) {
994 options.gtest_color = args[i] + strlen("--gtest_color=");
995 } else if (strcmp(args[i], "--gtest_print_time=0") == 0) {
997 } else if (strncmp(args[i], "--gtest_repeat=", strlen("--gtest_repeat=")) == 0) {
1000 options.gtest_repeat = atoi(args[i] + strlen("--gtest_repeat="));
1002 args.erase(args.begin() + i);
1004 } else if (strncmp(args[i], "--gtest_output=", strlen("--gtest_output=")) == 0) {
1005 std::string output = args[i] + strlen("--gtest_output=");
1031 fprintf(stderr, "invalid gtest_output file: %s\n", args[i]);
1036 args.erase(args.begin() + i);
1041 // Add --no-isolate in args to prevent child process from running in isolation mode again.
1043 args.insert(args.begin() + 1, strdup("--no-isolate"));