[igt-dev] [PATCH i-g-t v2] runner: Exit with 0 on dry-run

Petri Latvala petri.latvala at intel.com
Tue Feb 19 10:18:10 UTC 2019


v2: Adjust tests accordingly

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
Cc: Tomi Sarvela <tomi.p.sarvela at intel.com>
---
 runner/executor.c     | 2 +-
 runner/runner_tests.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 3f1eb010..d535c276 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1208,7 +1208,7 @@ bool execute(struct execute_state *state,
 
 	if (state->dry) {
 		printf("Dry run, not executing. Invoke igt_resume if you want to execute.\n");
-		return false;
+		return true;
 	}
 
 	if ((resdirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) {
diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index 0965612a..e46568ac 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -773,8 +773,9 @@ igt_main
 				     "Dry run initialization didn't create the results directory.\n");
 
 			/* Execute from just initialize_execute_state should fail */
-			igt_assert(!execute(&state, &settings, &list));
-			igt_assert(openat(dirfd, "0", O_DIRECTORY | O_RDONLY) < 0);
+			igt_assert(execute(&state, &settings, &list));
+			igt_assert_f(openat(dirfd, "0", O_DIRECTORY | O_RDONLY) < 0,
+				     "Dry run executed when it should not have.\n");
 			igt_assert_f((fd = openat(dirfd, "metadata.txt", O_RDONLY)) >= 0,
 				     "Dry run initialization didn't serialize settings.\n");
 			close(fd);
-- 
2.19.1



More information about the igt-dev mailing list