summaryrefslogtreecommitdiff
path: root/source4/lib/torture/torture.h
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-31 16:37:02 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-10-31 16:37:02 +0100
commitc7cedd3a67b08be933a3101162bd5745284c8bf8 (patch)
treec2d704f83a439a2e0fd861d002ff8261652f0c8f /source4/lib/torture/torture.h
parent161cb81911fe8877bfefd8bd3553f0b3166299fb (diff)
downloadsamba-c7cedd3a67b08be933a3101162bd5745284c8bf8.tar.gz
samba-c7cedd3a67b08be933a3101162bd5745284c8bf8.tar.bz2
samba-c7cedd3a67b08be933a3101162bd5745284c8bf8.zip
Add comments in torture code, allow creating subcontexts.
Diffstat (limited to 'source4/lib/torture/torture.h')
-rw-r--r--source4/lib/torture/torture.h26
1 files changed, 22 insertions, 4 deletions
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__ */