Lines Matching +full:com +full:- +full:seq

1 // SPDX-License-Identifier: GPL-2.0
4 * Author: Alan Maguire <alan.maguire@oracle.com>
11 #include <kunit/test-bug.h>
13 #include "string-stream.h"
44 static void debugfs_print_result(struct seq_file *seq, struct string_stream *log) in debugfs_print_result() argument
55 spin_lock(&log->lock); in debugfs_print_result()
56 list_for_each_entry(frag_container, &log->fragments, node) in debugfs_print_result()
57 seq_printf(seq, "%s", frag_container->fragment); in debugfs_print_result()
58 spin_unlock(&log->lock); in debugfs_print_result()
64 static int debugfs_print_results(struct seq_file *seq, void *v) in debugfs_print_results() argument
66 struct kunit_suite *suite = (struct kunit_suite *)seq->private; in debugfs_print_results()
76 seq_puts(seq, "KTAP version 1\n"); in debugfs_print_results()
77 seq_puts(seq, "1..1\n"); in debugfs_print_results()
80 seq_puts(seq, KUNIT_SUBTEST_INDENT "KTAP version 1\n"); in debugfs_print_results()
81 seq_printf(seq, KUNIT_SUBTEST_INDENT "# Subtest: %s\n", suite->name); in debugfs_print_results()
82 seq_printf(seq, KUNIT_SUBTEST_INDENT "1..%zd\n", kunit_suite_num_test_cases(suite)); in debugfs_print_results()
85 debugfs_print_result(seq, test_case->log); in debugfs_print_results()
87 debugfs_print_result(seq, suite->log); in debugfs_print_results()
89 seq_printf(seq, "%s %d %s\n", in debugfs_print_results()
90 kunit_status_to_ok_not_ok(success), 1, suite->name); in debugfs_print_results()
103 suite = (struct kunit_suite *)inode->i_private; in debugfs_results_open()
112 static int debugfs_print_run(struct seq_file *seq, void *v) in debugfs_print_run() argument
114 struct kunit_suite *suite = (struct kunit_suite *)seq->private; in debugfs_print_run()
116 seq_puts(seq, "Write to this file to trigger the test suite to run.\n"); in debugfs_print_run()
117 seq_printf(seq, "usage: echo \"any string\" > /sys/kernel/debugfs/kunit/%s/run\n", in debugfs_print_run()
118 suite->name); in debugfs_print_run()
131 suite = (struct kunit_suite *)inode->i_private; in debugfs_run_open()
145 struct inode *f_inode = file->f_inode; in debugfs_run()
146 struct kunit_suite *suite = (struct kunit_suite *) f_inode->i_private; in debugfs_run()
174 if (suite->log) in kunit_debugfs_create_suite()
179 * The suite->log and test_case->log pointer are expected to be NULL in kunit_debugfs_create_suite()
188 suite->log = stream; in kunit_debugfs_create_suite()
196 test_case->log = stream; in kunit_debugfs_create_suite()
199 suite->debugfs = debugfs_create_dir(suite->name, debugfs_rootdir); in kunit_debugfs_create_suite()
202 suite->debugfs, in kunit_debugfs_create_suite()
205 /* Do not create file to re-run test if test runs on init */ in kunit_debugfs_create_suite()
206 if (!suite->is_init) { in kunit_debugfs_create_suite()
208 suite->debugfs, in kunit_debugfs_create_suite()
214 string_stream_destroy(suite->log); in kunit_debugfs_create_suite()
216 string_stream_destroy(test_case->log); in kunit_debugfs_create_suite()
223 debugfs_remove_recursive(suite->debugfs); in kunit_debugfs_destroy_suite()
224 string_stream_destroy(suite->log); in kunit_debugfs_destroy_suite()
226 string_stream_destroy(test_case->log); in kunit_debugfs_destroy_suite()