@@ -2028,6 +2028,33 @@ void igt_exit(void)
exit(igt_exitcode);
}
+/**
+ * igt_exit_early()
+ *
+ * Call igt_exit() after dealing with assumptions not valid for early calls.
+ *
+ * In particular:
+ * igt_exit() assumes that subtests have been considered for execution
+ * and complains if a subtest specified by --run-subtest was not executed.
+ * (The expectation is that the subtest would have been executed if it existed).
+ *
+ * In particular:
+ * igt_exit() assumes that subtests have been considered for execution.
+ * With --run-subtest, for an early exit (where subtests had not yet been
+ * considered):
+ * - igt_exit() would complain about "Unknown subtest"
+ * - igt_exit() would exit prematurely.
+ */
+void igt_exit_early(void)
+{
+ if (run_single_subtest) {
+ free(run_single_subtest);
+ run_single_subtest = NULL;
+ }
+
+ igt_exit();
+}
+
/* fork support code */
static int helper_process_count;
static pid_t helper_process_pids[] =
@@ -500,6 +500,7 @@ void __igt_fail_assert(const char *domain, const char *file,
const char *format, ...)
__attribute__((noreturn));
void igt_exit(void) __attribute__((noreturn));
+void igt_exit_early(void) __attribute__((noreturn));
void igt_fatal_error(void) __attribute__((noreturn));
/**
Call igt_exit() after dealing with assumptions not valid for early calls. In particular: igt_exit() assumes that subtests have been considered for execution. With --run-subtest, for an early exit (where subtests had not yet been considered): - igt_exit() would complain about "Unknown subtest" - igt_exit() would exit prematurely. Signed-off-by: Dale B Stimson <dale.b.stimson@intel.com> --- lib/igt_core.c | 27 +++++++++++++++++++++++++++ lib/igt_core.h | 1 + 2 files changed, 28 insertions(+)