From c7cedd3a67b08be933a3101162bd5745284c8bf8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 31 Oct 2008 16:37:02 +0100 Subject: Add comments in torture code, allow creating subcontexts. --- source4/lib/torture/torture.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'source4/lib/torture/torture.h') diff --git a/source4/lib/torture/torture.h b/source4/lib/torture/torture.h index ea5cd70961..0a84cef84a 100644 --- a/source4/lib/torture/torture.h +++ b/source4/lib/torture/torture.h @@ -80,17 +80,24 @@ struct torture_context struct torture_test *active_test; struct torture_tcase *active_tcase; - bool quiet; /* Whether tests should avoid writing output to stdout */ + /** Whether tests should avoid writing output to stdout */ + bool quiet; enum torture_result last_result; char *last_reason; bool returncode; + /** Directory used for temporary test data */ const char *outputdir; + + /** Indentation level */ int level; + + /** Event context */ struct event_context *ev; + /** Loadparm context (will go away in favor of torture_setting_ at some point) */ struct loadparm_context *lp_ctx; }; @@ -98,19 +105,28 @@ struct torture_context * Describes a particular torture test */ struct torture_test { + /** Short unique name for the test. */ const char *name; + + /** Long description for the test. */ const char *description; + + /** Whether this is a dangerous test + * (can corrupt the remote servers data or bring it down). */ bool dangerous; - /* Function to call to run this test */ + + /** Function to call to run this test */ bool (*run) (struct torture_context *torture_ctx, struct torture_tcase *tcase, struct torture_test *test); struct torture_test *prev, *next; - /* Pointer to the actual test function. This is run by the - * run() function above. */ + /** Pointer to the actual test function. This is run by the + * run() function above. */ void *fn; + + /** Use data for this test */ const void *data; }; @@ -393,6 +409,8 @@ bool torture_suite_init_tcase(struct torture_suite *suite, struct torture_context *torture_context_init(struct event_context *event_ctx, const struct torture_ui_ops *ui_ops); +struct torture_context *torture_context_child(struct torture_context *tctx); + extern const struct torture_ui_ops torture_subunit_ui_ops; #endif /* __TORTURE_UI_H__ */ -- cgit