2 * ====================================================================
3 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
5 * This software is licensed as described in the file COPYING, which
6 * you should have received as part of this distribution. The terms
7 * are also available at http://subversion.tigris.org/license-1.html.
8 * If newer versions of this license are posted there, you may use a
9 * newer version instead, at your option.
11 * This software consists of voluntary contributions made by many
12 * individuals. For exact contribution history, see the revision
13 * history and logs, available at http://subversion.tigris.org/.
14 * ====================================================================
20 #include <apr_pools.h>
21 #include "svn_delta.h"
23 #include "svn_types.h"
24 #include "svn_error.h"
25 #include "svn_string.h"
30 #endif /* __cplusplus */
33 /* Baton for any arguments that need to be passed from main() to svn
36 typedef struct svn_test_opts_t
38 /* Description of the fs backend that should be used for testing. */
40 /* Add future "arguments" here. */
43 /* Prototype for test driver functions. */
44 typedef svn_error_t
* (*svn_test_driver_t
)(const char **msg
,
45 svn_boolean_t msg_only
,
46 svn_test_opts_t
*opts
,
57 /* Each test gets a test descriptor, holding the function and other
60 struct svn_test_descriptor_t
62 /* A pointer to the test driver function. */
63 svn_test_driver_t func
;
65 /* Is the test marked XFAIL? */
66 enum svn_test_mode_t mode
;
69 /* All Subversion test programs include an array of svn_test_descriptor_t's
70 * (all of our sub-tests) that begins and ends with a SVN_TEST_NULL entry.
72 extern struct svn_test_descriptor_t test_funcs
[];
74 /* A null initializer for the test descriptor. */
75 #define SVN_TEST_NULL {NULL, 0}
77 /* Initializer for PASS tests */
78 #define SVN_TEST_PASS(func) {func, svn_test_pass}
80 /* Initializer for XFAIL tests */
81 #define SVN_TEST_XFAIL(func) {func, svn_test_xfail}
83 /* Initializer for conditional XFAIL tests */
84 #define SVN_TEST_XFAIL_COND(func, p)\
85 {func, (p) ? svn_test_xfail : svn_test_pass}
87 /* Initializer for SKIP tests */
88 #define SVN_TEST_SKIP(func, p) {func, ((p) ? svn_test_skip : svn_test_pass)}
91 /* Return a pseudo-random number based on SEED, and modify SEED.
93 * This is a "good" pseudo-random number generator, intended to replace
94 * all those "bad" rand() implementations out there.
96 apr_uint32_t
svn_test_rand(apr_uint32_t
*seed
);
99 /* Add PATH to the test cleanup list. */
100 void svn_test_add_dir_cleanup(const char *path
);
104 /* Set *EDITOR and *EDIT_BATON to an editor that prints its
105 * arguments to OUT_STREAM. The edit starts at PATH, that is,
106 * PATH will be prepended to the appropriate paths in the output.
107 * Allocate the editor in POOL.
109 * EDITOR_NAME is a name for the editor, a string that will be
110 * prepended to the editor output as shown below. EDITOR_NAME may
111 * be the empty string (but it may not be null).
113 * VERBOSE is a flag for specifying whether or not your want all the
114 * nitty gritty details displayed. When VERBOSE is FALSE, each
115 * editor function will print only a one-line summary.
117 * INDENTATION is the number of spaces to indent by at each level; use
118 * 0 for no indentation. The indent level is always the same for a
119 * given call (i.e, stack frame).
123 * With an indentation of 3, editor name of "COMMIT-TEST" and with
126 * [COMMIT-TEST] open_root (wc)
128 * [COMMIT-TEST] open_directory (wc/A)
131 * [COMMIT-TEST] delete_entry (wc/A/B)
132 * [COMMIT-TEST] open_file (wc/A/mu)
135 * [COMMIT-TEST] change_file_prop (wc/A/mu)
138 * [COMMIT-TEST] close_file (wc/A/mu)
139 * [COMMIT-TEST] close_directory (wc/A)
140 * [COMMIT-TEST] add_file (wc/zeta)
143 * copyfrom_revision: 0
144 * [COMMIT-TEST] open_file (wc/iota)
147 * [COMMIT-TEST] close_directory (wc)
148 * [COMMIT-TEST] apply_textdelta (wc/iota)
149 * [COMMIT-TEST] window_handler (2 ops)
150 * (1) new text: length 11
151 * (2) source text: offset 0, length 0
152 * [COMMIT-TEST] window_handler (EOT)
153 * [COMMIT-TEST] close_file (wc/iota)
154 * [COMMIT-TEST] apply_textdelta (wc/zeta)
155 * [COMMIT-TEST] window_handler (1 ops)
156 * (1) new text: length 11
157 * [COMMIT-TEST] window_handler (EOT)
158 * [COMMIT-TEST] close_file (wc/zeta)
159 * [COMMIT-TEST] close_edit
161 * The same example as above, but with verbose = FALSE
163 * [COMMIT-TEST] open_root (wc)
164 * [COMMIT-TEST] open_directory (wc/A)
165 * [COMMIT-TEST] delete_entry (wc/A/B)
166 * [COMMIT-TEST] open_file (wc/A/mu)
167 * [COMMIT-TEST] change_file_prop (wc/A/mu)
168 * [COMMIT-TEST] close_file (wc/A/mu)
169 * [COMMIT-TEST] close_directory (wc/A)
170 * [COMMIT-TEST] add_file (wc/zeta)
171 * [COMMIT-TEST] open_file (wc/iota)
172 * [COMMIT-TEST] close_directory (wc)
173 * [COMMIT-TEST] apply_textdelta (wc/iota)
174 * [COMMIT-TEST] close_file (wc/iota)
175 * [COMMIT-TEST] apply_textdelta (wc/zeta)
176 * [COMMIT-TEST] close_file (wc/zeta)
177 * [COMMIT-TEST] close_edit
180 svn_error_t
*svn_test_get_editor(const svn_delta_editor_t
**editor
,
182 const char *editor_name
,
183 svn_stream_t
*out_stream
,
185 svn_boolean_t verbose
,
191 #endif /* __cplusplus */
193 #endif /* SVN_TEST_H */