int main(int argc, char *argv[])
{
- bool opt_repeat= false;
+ bool opt_massive= false;
+ unsigned long int opt_repeat= 1; // Run all tests once
bool opt_quiet= false;
std::string collection_to_run;
enum long_option_t {
OPT_LIBYATL_VERSION,
OPT_LIBYATL_MATCH_COLLECTION,
+ OPT_LIBYATL_MASSIVE,
OPT_LIBYATL_QUIET,
OPT_LIBYATL_REPEAT
};
{ "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },
{ "repeat", no_argument, NULL, OPT_LIBYATL_REPEAT },
{ "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },
+ { "massive", no_argument, NULL, OPT_LIBYATL_MASSIVE },
{ 0, 0, 0, 0 }
};
break;
case OPT_LIBYATL_REPEAT:
- opt_repeat= true;
+ opt_repeat= strtoul(optarg, (char **) NULL, 10);
break;
case OPT_LIBYATL_MATCH_COLLECTION:
collection_to_run= optarg;
break;
+ case OPT_LIBYATL_MASSIVE:
+ opt_massive= true;
+ break;
+
case '?':
/* getopt_long already printed an error message. */
Error << "unknown option to getopt_long()";
srandom((unsigned int)time(NULL));
- int repeat;
- if (bool(getenv("YATL_REPEAT")) and (repeat= atoi(getenv("YATL_REPEAT"))))
+ if (bool(getenv("YATL_REPEAT")) and (strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10) > 1))
{
- opt_repeat= true;
+ opt_repeat= strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10);
}
- if ((getenv("YATL_QUIET") and strcmp(getenv("YATL_QUIET"), "0") == 0) or opt_quiet)
+ if ((bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "0") == 0)) or opt_quiet)
{
opt_quiet= true;
}
else if (getenv("JENKINS_URL"))
{
- if (getenv("YATL_QUIET") and strcmp(getenv("YATL_QUIET"), "1") == 0)
+ if (bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "1") == 0))
{ }
else
{
return EXIT_FAILURE;
}
- if (getenv("TEST_COLLECTION"))
+ if (getenv("YATL_COLLECTION_TO_RUN"))
{
- if (strlen(getenv("TEST_COLLECTION")))
+ if (strlen(getenv("YATL_COLLECTION_TO_RUN")))
{
- collection_to_run= getenv("TEST_COLLECTION");
+ collection_to_run= getenv("YATL_COLLECTION_TO_RUN");
}
}
+ if (collection_to_run.compare("none") == 0)
+ {
+ return EXIT_SUCCESS;
+ }
+
if (collection_to_run.empty() == false)
{
Out << "Only testing " << collection_to_run;
goto cleanup;
default:
- throw fatal_message("invalid return code");
+ fatal_message("invalid return code");
}
Out << "Collection: " << next->name;
}
}
+ catch (libtest::fatal &e)
+ {
+ Error << "Fatal exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ }
catch (std::exception &e)
{
Error << "Exception was thrown: " << e.what();
break;
default:
- throw fatal_message("invalid return code");
+ fatal_message("invalid return code");
}
if (test_failed(world.on_error(return_code, creators_ptr)))
stats_print(&stats);
Outn(); // Generate a blank to break up the messages if make check/test has been run
- } while (exit_code == EXIT_SUCCESS and opt_repeat);
+ } while (exit_code == EXIT_SUCCESS and --opt_repeat);
}
catch (libtest::fatal& e)
{