linux/lib/kunit/executor.c

// SPDX-License-Identifier: GPL-2.0

#include <linux/reboot.h>
#include <kunit/test.h>
#include <kunit/attributes.h>
#include <linux/glob.h>
#include <linux/moduleparam.h>

/*
 * These symbols point to the .kunit_test_suites section and are defined in
 * include/asm-generic/vmlinux.lds.h, and consequently must be extern.
 */
extern struct kunit_suite * const __kunit_suites_start[];
extern struct kunit_suite * const __kunit_suites_end[];
extern struct kunit_suite * const __kunit_init_suites_start[];
extern struct kunit_suite * const __kunit_init_suites_end[];

static char *action_param;

module_param_named(action, action_param, charp, 0400);
MODULE_PARM_DESC();

const char *kunit_action(void)
{}

static char *filter_glob_param;
static char *filter_param;
static char *filter_action_param;

module_param_named(filter_glob, filter_glob_param, charp, 0600);
MODULE_PARM_DESC();
module_param_named(filter, filter_param, charp, 0600);
MODULE_PARM_DESC();
module_param_named(filter_action, filter_action_param, charp, 0600);
MODULE_PARM_DESC();

const char *kunit_filter_glob(void)
{}

char *kunit_filter(void)
{}

char *kunit_filter_action(void)
{}

/* glob_match() needs NULL terminated strings, so we need a copy of filter_glob_param. */
struct kunit_glob_filter {};

/* Split "suite_glob.test_glob" into two. Assumes filter_glob is not empty. */
static int kunit_parse_glob_filter(struct kunit_glob_filter *parsed,
				    const char *filter_glob)
{}

/* Create a copy of suite with only tests that match test_glob. */
static struct kunit_suite *
kunit_filter_glob_tests(const struct kunit_suite *const suite, const char *test_glob)
{}

void kunit_free_suite_set(struct kunit_suite_set suite_set)
{}

/*
 * Filter and reallocate test suites. Must return the filtered test suites set
 * allocated at a valid virtual address or NULL in case of error.
 */
struct kunit_suite_set
kunit_filter_suites(const struct kunit_suite_set *suite_set,
		    const char *filter_glob,
		    char *filters,
		    char *filter_action,
		    int *err)
{}

void kunit_exec_run_tests(struct kunit_suite_set *suite_set, bool builtin)
{}

void kunit_exec_list_tests(struct kunit_suite_set *suite_set, bool include_attr)
{}

struct kunit_suite_set kunit_merge_suite_sets(struct kunit_suite_set init_suite_set,
		struct kunit_suite_set suite_set)
{}

#if IS_BUILTIN(CONFIG_KUNIT)

static char *kunit_shutdown;
core_param();

static void kunit_handle_shutdown(void)
{}

int kunit_run_all_tests(void)
{}

#if IS_BUILTIN(CONFIG_KUNIT_TEST)
#include "executor_test.c"
#endif

#endif /* IS_BUILTIN(CONFIG_KUNIT) */