From 96f3a1b876e0dd24706b85fb872f12031a436e84 Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Tue, 22 Jan 2019 12:47:23 +0200 Subject: runner: Implement --dry-run Actually implement --dry-run to not execute tests. With dry-run active, attempting to execute will figure out the list of things to execute, serialize them along with settings, and stop. This will be useful for CI that wants to post-mortem on failed test rounds to generate a list of tests that should have been executed and produce json result files (full of 'notrun') for proper statistics. Signed-off-by: Petri Latvala Cc: Andi Shyti Cc: Martin Peres Cc: Arkadiusz Hiler Cc: Tomi Sarvela Reviewed-by: Martin Peres --- runner/executor.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runner/executor.c') diff --git a/runner/executor.c b/runner/executor.c index 54c530b7..3f1eb010 100644 --- a/runner/executor.c +++ b/runner/executor.c @@ -1153,6 +1153,8 @@ bool initialize_execute_state(struct execute_state *state, init_time_left(state, settings); + state->dry = settings->dry_run; + return true; } @@ -1204,6 +1206,11 @@ bool execute(struct execute_state *state, double time_spent = 0.0; bool status = true; + if (state->dry) { + printf("Dry run, not executing. Invoke igt_resume if you want to execute.\n"); + return false; + } + if ((resdirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) { /* Initialize state should have done this */ fprintf(stderr, "Error: Failure opening results path %s\n", -- cgit v1.2.3