summaryrefslogtreecommitdiff
path: root/runner/settings.c
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2018-10-10 13:41:00 +0300
committerPetri Latvala <petri.latvala@intel.com>2018-10-19 16:04:14 +0300
commit78619fde4008424c472906041edb1d204e014f7c (patch)
tree52d1284b26f4a54bd4798d01c5f6c4b4e72d63db /runner/settings.c
parent6f27fddc6dd79c0486181b64201c6773c5c42a24 (diff)
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 <petri.latvala@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106127 Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'runner/settings.c')
-rw-r--r--runner/settings.c9
1 files changed, 9 insertions, 0 deletions
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 <seconds>\n"
" Kill the running test after <seconds> of inactivity in\n"
" the test's stdout, stderr, or dmesg\n"
+ " --overall-timeout <seconds>\n"
+ " Don't execute more tests after <seconds> 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);