2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 1997-2003
5 Copyright (C) Jelmer Vernooij 2006-2008
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "lib/torture/torture.h"
24 static struct timeval last_suite_started;
26 static void simple_suite_start(struct torture_context *ctx,
27 struct torture_suite *suite)
29 last_suite_started = timeval_current();
30 printf("Running %s\n", suite->name);
33 static void simple_suite_finish(struct torture_context *ctx,
34 struct torture_suite *suite)
37 printf("%s took %g secs\n\n", suite->name,
38 timeval_elapsed(&last_suite_started));
41 static void simple_test_result(struct torture_context *context,
42 enum torture_result res, const char *reason)
47 printf("OK: %s\n", reason);
50 printf("TEST %s FAILED! - %s\n", context->active_test->name, reason);
53 printf("ERROR IN TEST %s! - %s\n", context->active_test->name, reason);
56 printf("SKIP: %s - %s\n", context->active_test->name, reason);
61 static void simple_comment(struct torture_context *test,
64 printf("%s", comment);
67 static void simple_warning(struct torture_context *test,
70 fprintf(stderr, "WARNING: %s\n", comment);
73 static void simple_progress(struct torture_context *test,
74 int offset, enum torture_progress_whence whence)
78 const struct torture_ui_ops torture_simple_ui_ops = {
79 .comment = simple_comment,
80 .warning = simple_warning,
81 .suite_start = simple_suite_start,
82 .suite_finish = simple_suite_finish,
83 .test_result = simple_test_result,
84 .progress = simple_progress,