linux/lib/kunit/debugfs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2020, Oracle and/or its affiliates.
 *    Author: Alan Maguire <[email protected]>
 */

#include <linux/debugfs.h>
#include <linux/module.h>

#include <kunit/test.h>
#include <kunit/test-bug.h>

#include "string-stream.h"
#include "debugfs.h"

#define KUNIT_DEBUGFS_ROOT
#define KUNIT_DEBUGFS_RESULTS
#define KUNIT_DEBUGFS_RUN

/*
 * Create a debugfs representation of test suites:
 *
 * Path						Semantics
 * /sys/kernel/debug/kunit/<testsuite>/results	Show results of last run for
 *						testsuite
 * /sys/kernel/debug/kunit/<testsuite>/run	Write to this file to trigger
 *						testsuite to run
 *
 */

static struct dentry *debugfs_rootdir;

void kunit_debugfs_cleanup(void)
{}

void kunit_debugfs_init(void)
{}

static void debugfs_print_result(struct seq_file *seq, struct string_stream *log)
{}

/*
 * /sys/kernel/debug/kunit/<testsuite>/results shows all results for testsuite.
 */
static int debugfs_print_results(struct seq_file *seq, void *v)
{}

static int debugfs_release(struct inode *inode, struct file *file)
{}

static int debugfs_results_open(struct inode *inode, struct file *file)
{}

/*
 * Print a usage message to the debugfs "run" file
 * (/sys/kernel/debug/kunit/<testsuite>/run) if opened.
 */
static int debugfs_print_run(struct seq_file *seq, void *v)
{}

/*
 * The debugfs "run" file (/sys/kernel/debug/kunit/<testsuite>/run)
 * contains no information. Write to the file to trigger the test suite
 * to run.
 */
static int debugfs_run_open(struct inode *inode, struct file *file)
{}

/*
 * Trigger a test suite to run by writing to the suite's "run" debugfs
 * file found at: /sys/kernel/debug/kunit/<testsuite>/run
 *
 * Note: what is written to this file will not be saved.
 */
static ssize_t debugfs_run(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos)
{}

static const struct file_operations debugfs_results_fops =;

static const struct file_operations debugfs_run_fops =;

void kunit_debugfs_create_suite(struct kunit_suite *suite)
{}

void kunit_debugfs_destroy_suite(struct kunit_suite *suite)
{}