1 /*******************************/
2 /* GENERATED FILE, DO NOT EDIT */
3 /*******************************/
9 extern xbt_test_unit_t _xbt_current_unit;
11 /* SGU: BEGIN PROTOTYPES */
12 /* SGU: BEGIN FILE xbt/cunit.c */
13 void test_expected_failure(void);
16 /* SGU: BEGIN FILE xbt/ex.c */
17 void test_controlflow(void);
18 void test_value(void);
19 void test_variables(void);
20 void test_cleanup(void);
23 /* SGU: BEGIN FILE xbt/dynar.c */
24 void test_dynar_int(void);
25 void test_dynar_insert(void);
26 void test_dynar_double(void);
27 void test_dynar_string(void);
28 void test_dynar_sync_int(void);
31 /* SGU: BEGIN FILE xbt/dict.c */
32 void test_dict_basic(void);
33 void test_dict_remove(void);
34 void test_dict_nulldata(void);
35 void test_dict_scalar(void);
36 void test_dict_crash(void);
37 void test_dict_multicrash(void);
40 /* SGU: BEGIN FILE xbt/set.c */
41 void test_set_basic(void);
42 void test_set_change(void);
43 void test_set_retrieve(void);
44 void test_set_remove(void);
47 /* SGU: BEGIN FILE xbt/swag.c */
48 void test_swag_basic(void);
51 /* SGU: BEGIN FILE xbt/xbt_str.c */
52 void test_split_quoted(void);
53 void test_split_str(void);
56 /* SGU: BEGIN FILE xbt/xbt_strbuff.c */
57 void test_strbuff_substitute(void);
60 /* SGU: BEGIN FILE xbt/xbt_sha.c */
61 void test_crypto_sha(void);
64 /* SGU: BEGIN FILE xbt/config.c */
65 void test_config_memuse(void);
66 void test_config_validation(void);
67 void test_config_use(void);
70 /* SGU: BEGIN FILE xbt/xbt_synchro.c */
71 void test_dynar_dopar(void);
74 /* SGU: END PROTOTYPES */
76 /*******************************/
77 /* GENERATED FILE, DO NOT EDIT */
78 /*******************************/
80 int main(int argc, char *argv[]) {
81 xbt_test_suite_t suite;
87 /* SGU: BEGIN SUITES DECLARATION */
88 /* SGU: BEGIN FILE xbt/cunit.c */
89 suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
90 xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
93 /* SGU: BEGIN FILE xbt/ex.c */
94 suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
95 xbt_test_suite_push(suite, "controlflow", test_controlflow, "basic nested control flow");
96 xbt_test_suite_push(suite, "value", test_value, "exception value passing");
97 xbt_test_suite_push(suite, "variables", test_variables, "variable value preservation");
98 xbt_test_suite_push(suite, "cleanup", test_cleanup, "cleanup handling");
101 /* SGU: BEGIN FILE xbt/dynar.c */
102 suite = xbt_test_suite_by_name("dynar","Dynar data container");
103 xbt_test_suite_push(suite, "int", test_dynar_int, "Dynars of integers");
104 xbt_test_suite_push(suite, "insert", test_dynar_insert, "Using the xbt_dynar_insert and xbt_dynar_remove functions");
105 xbt_test_suite_push(suite, "double", test_dynar_double, "Dynars of doubles");
106 xbt_test_suite_push(suite, "string", test_dynar_string, "Dynars of strings");
107 xbt_test_suite_push(suite, "synchronized int", test_dynar_sync_int, "Synchronized dynars of integers");
110 /* SGU: BEGIN FILE xbt/dict.c */
111 suite = xbt_test_suite_by_name("dict","Dict data container");
112 xbt_test_suite_push(suite, "basic", test_dict_basic, "Basic usage: change, retrieve, traverse");
113 xbt_test_suite_push(suite, "remove", test_dict_remove, "Removing some values");
114 xbt_test_suite_push(suite, "nulldata", test_dict_nulldata, "NULL data management");
115 xbt_test_suite_push(suite, "dicti", test_dict_scalar, "Scalar data and key management");
116 xbt_test_suite_push(suite, "crash", test_dict_crash, "Crash test");
117 xbt_test_suite_push(suite, "multicrash", test_dict_multicrash, "Multi-dict crash test");
120 /* SGU: BEGIN FILE xbt/set.c */
121 suite = xbt_test_suite_by_name("set","Set data container");
122 xbt_test_suite_push(suite, "basic", test_set_basic, "Basic usage");
123 xbt_test_suite_push(suite, "change", test_set_change, "Changing some values");
124 xbt_test_suite_push(suite, "retrieve", test_set_retrieve, "Retrieving some values");
125 xbt_test_suite_push(suite, "remove", test_set_remove, "Removing some values");
128 /* SGU: BEGIN FILE xbt/swag.c */
129 suite = xbt_test_suite_by_name("swag","Swag data container");
130 xbt_test_suite_push(suite, "basic", test_swag_basic, "Basic usage");
133 /* SGU: BEGIN FILE xbt/xbt_str.c */
134 suite = xbt_test_suite_by_name("xbt_str","String Handling");
135 xbt_test_suite_push(suite, "xbt_str_split_quoted", test_split_quoted, "test the function xbt_str_split_quoted");
136 xbt_test_suite_push(suite, "xbt_str_split_str", test_split_str, "test the function xbt_str_split_str");
139 /* SGU: BEGIN FILE xbt/xbt_strbuff.c */
140 suite = xbt_test_suite_by_name("xbt_strbuff","String Buffers");
141 xbt_test_suite_push(suite, "xbt_strbuff_substitute", test_strbuff_substitute, "test the function xbt_strbuff_substitute");
144 /* SGU: BEGIN FILE xbt/xbt_sha.c */
145 suite = xbt_test_suite_by_name("hash","Various hash functions");
146 xbt_test_suite_push(suite, "sha", test_crypto_sha, "Test of the sha algorithm");
149 /* SGU: BEGIN FILE xbt/config.c */
150 suite = xbt_test_suite_by_name("config","Configuration support");
151 xbt_test_suite_push(suite, "memuse", test_config_memuse, "Alloc and free a config set");
152 xbt_test_suite_push(suite, "validation", test_config_validation, "Validation tests");
153 xbt_test_suite_push(suite, "use", test_config_use, "Data retrieving tests");
156 /* SGU: BEGIN FILE xbt/xbt_synchro.c */
157 suite = xbt_test_suite_by_name("synchro","Advanced synchronization mecanisms");
158 xbt_test_suite_push(suite, "dopar", test_dynar_dopar, "do parallel on dynars of integers");
161 /* SGU: END SUITES DECLARATION */
163 xbt_init(&argc,argv);
165 /* Search for the tests to do */
167 for (i=1;i<argc;i++) {
168 if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
169 char *p=strchr(argv[i],'=')+1;
170 if (selection[0] == '\0') {
171 strcpy(selection, p);
173 strcat(selection, ",");
174 strcat(selection, p);
176 } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
177 !strncmp(argv[i],"--dump", strlen("--dump"))) {
178 xbt_test_dump(selection);
180 } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
182 "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
183 "--help: display this help\n"
184 "--dump-only: don't run the tests, but display some debuging info about the tests\n"
185 "--tests=selection: Use argument to select which suites/units/tests to run\n"
186 " --tests can be used more than once, and selection may be a comma\n"
187 " separated list of directives.\n\n"
188 "Directives are of the form:\n"
189 " [-]suitename[:unitname]\n\n"
190 "If the first char is a '-', the directive disables its argument instead of enabling it\n"
191 "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
192 "it applies on any unit.\n\n"
193 "By default, everything is enabled.\n\n"
194 "'all' as suite name apply to all suites.\n\n"
195 "Example 1: \"-toto,+toto:tutu\"\n"
196 " disables the whole toto testsuite (any unit in it),\n"
197 " then reenables the tutu unit of the toto test suite.\n\n"
198 "Example 2: \"-all,+toto\"\n"
199 " Run nothing but the toto suite.\n");
202 printf("testall: Unknown option: %s\n",argv[i]);
206 /* Got all my tests to do */
208 res = xbt_test_run(selection);
212 /*******************************/
213 /* GENERATED FILE, DO NOT EDIT */
214 /*******************************/