From 78619fde4008424c472906041edb1d204e014f7c Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Wed, 10 Oct 2018 13:41:00 +0300 Subject: runner: Add --overall-timeout With --overall-timeout $foo, the runner will stop executing new tests when $foo seconds have already been used. A resumed run will start over with no time used, using the same timeout. This allows for executing a long list of tests piecemeal, in about $foo length executions. Signed-off-by: Petri Latvala Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106127 Cc: Arkadiusz Hiler Cc: Tomi Sarvela Cc: Martin Peres Reviewed-by: Arkadiusz Hiler --- runner/settings.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runner/settings.c') diff --git a/runner/settings.c b/runner/settings.c index 70fff3c0..e2401455 100644 --- a/runner/settings.c +++ b/runner/settings.c @@ -17,6 +17,7 @@ enum { OPT_TEST_LIST, OPT_IGNORE_MISSING, OPT_PIGLIT_DMESG, + OPT_OVERALL_TIMEOUT, OPT_HELP = 'h', OPT_NAME = 'n', OPT_DRY_RUN = 'd', @@ -87,6 +88,8 @@ static const char *usage_str = " --inactivity-timeout \n" " Kill the running test after of inactivity in\n" " the test's stdout, stderr, or dmesg\n" + " --overall-timeout \n" + " Don't execute more tests after has elapsed\n" " --use-watchdog Use hardware watchdog for lethal enforcement of the\n" " above timeout. Killing the test process is still\n" " attempted at timeout trigger.\n" @@ -198,6 +201,7 @@ bool parse_options(int argc, char **argv, {"ignore-missing", no_argument, NULL, OPT_IGNORE_MISSING}, {"multiple-mode", no_argument, NULL, OPT_MULTIPLE}, {"inactivity-timeout", required_argument, NULL, OPT_TIMEOUT}, + {"overall-timeout", required_argument, NULL, OPT_OVERALL_TIMEOUT}, {"use-watchdog", no_argument, NULL, OPT_WATCHDOG}, {"piglit-style-dmesg", no_argument, NULL, OPT_PIGLIT_DMESG}, { 0, 0, 0, 0}, @@ -253,6 +257,9 @@ bool parse_options(int argc, char **argv, case OPT_TIMEOUT: settings->inactivity_timeout = atoi(optarg); break; + case OPT_OVERALL_TIMEOUT: + settings->overall_timeout = atoi(optarg); + break; case OPT_WATCHDOG: settings->use_watchdog = true; break; @@ -448,6 +455,7 @@ bool serialize_settings(struct settings *settings) SERIALIZE_LINE(f, settings, overwrite, "%d"); SERIALIZE_LINE(f, settings, multiple_mode, "%d"); SERIALIZE_LINE(f, settings, inactivity_timeout, "%d"); + SERIALIZE_LINE(f, settings, overall_timeout, "%d"); SERIALIZE_LINE(f, settings, use_watchdog, "%d"); SERIALIZE_LINE(f, settings, piglit_style_dmesg, "%d"); SERIALIZE_LINE(f, settings, test_root, "%s"); @@ -502,6 +510,7 @@ bool read_settings(struct settings *settings, int dirfd) PARSE_LINE(settings, name, val, overwrite, numval); PARSE_LINE(settings, name, val, multiple_mode, numval); PARSE_LINE(settings, name, val, inactivity_timeout, numval); + PARSE_LINE(settings, name, val, overall_timeout, numval); PARSE_LINE(settings, name, val, use_watchdog, numval); PARSE_LINE(settings, name, val, piglit_style_dmesg, numval); PARSE_LINE(settings, name, val, test_root, val ? strdup(val) : NULL); -- cgit v1.2.3