summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2023-01-26 12:53:37 +0200
committerPetri Latvala <petri.latvala@intel.com>2023-01-27 13:12:46 +0200
commit4dd7f09dd33e1918f33382aa3e4ce6bc9a424b2a (patch)
tree26a83e603b6f5f32cc797f4c060ea3a8f716d90e /runner
parentaee106bd559d8e01fafee82ea860fd85fb0cfe86 (diff)
runner: Refactor abort-checking to a helper function
Abort-condition checking at runtime will later use the helper differently. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arek@hiler.eu> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Acked-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Diffstat (limited to 'runner')
-rw-r--r--runner/executor.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/runner/executor.c b/runner/executor.c
index 9d3623b47..5b4e84d18 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -348,21 +348,21 @@ static const struct {
{ 0, 0 },
};
-static char *need_to_abort(const struct settings* settings)
+static char *_need_to_abort(int abort_mask, int log_level)
{
typeof(*abort_handlers) *it;
for (it = abort_handlers; it->condition; it++) {
char *abort;
- if (!(settings->abort_mask & it->condition))
+ if (!(abort_mask & it->condition))
continue;
abort = it->handler();
if (!abort)
continue;
- if (settings->log_level >= LOG_LEVEL_NORMAL)
+ if (log_level >= LOG_LEVEL_NORMAL)
errf("Aborting: %s\n", abort);
return abort;
@@ -371,6 +371,11 @@ static char *need_to_abort(const struct settings* settings)
return NULL;
}
+static char *need_to_abort(const struct settings *settings)
+{
+ return _need_to_abort(settings->abort_mask, settings->log_level);
+}
+
static void prune_subtest(struct job_list_entry *entry, const char *subtest)
{
char *excl;