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_double(void);
26 void test_dynar_string(void);
27 void test_dynar_sync_int(void);
30 /* SGU: BEGIN FILE xbt/dict.c */
31 void test_dict_basic(void);
32 void test_dict_remove(void);
33 void test_dict_nulldata(void);
34 void test_dict_crash(void);
35 void test_dict_multicrash(void);
38 /* SGU: BEGIN FILE xbt/set.c */
39 void test_set_basic(void);
40 void test_set_change(void);
41 void test_set_retrieve(void);
42 void test_set_remove(void);
45 /* SGU: BEGIN FILE xbt/swag.c */
46 void test_swag_basic(void);
49 /* SGU: BEGIN FILE xbt/xbt_str.c */
50 void test_split_quoted(void);
51 void test_split_str(void);
54 /* SGU: BEGIN FILE xbt/xbt_sha.c */
55 void test_crypto_sha(void);
58 /* SGU: BEGIN FILE xbt/config.c */
59 void test_config_memuse(void);
60 void test_config_validation(void);
61 void test_config_use(void);
65 /*******************************/
66 /* GENERATED FILE, DO NOT EDIT */
67 /*******************************/
69 int main(int argc, char *argv[]) {
70 xbt_test_suite_t suite;
76 /* SGU: BEGIN SUITES DECLARATION */
77 /* SGU: BEGIN FILE xbt/cunit.c */
78 suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
79 xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
82 /* SGU: BEGIN FILE xbt/ex.c */
83 suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
84 xbt_test_suite_push(suite, "controlflow", test_controlflow, "basic nested control flow");
85 xbt_test_suite_push(suite, "value", test_value, "exception value passing");
86 xbt_test_suite_push(suite, "variables", test_variables, "variable value preservation");
87 xbt_test_suite_push(suite, "cleanup", test_cleanup, "cleanup handling");
90 /* SGU: BEGIN FILE xbt/dynar.c */
91 suite = xbt_test_suite_by_name("dynar","Dynar data container");
92 xbt_test_suite_push(suite, "int", test_dynar_int, "Dynars of integers");
93 xbt_test_suite_push(suite, "double", test_dynar_double, "Dynars of doubles");
94 xbt_test_suite_push(suite, "string", test_dynar_string, "Dyars of strings");
95 xbt_test_suite_push(suite, "synchronized int", test_dynar_sync_int, "Synchronized dynars of integers");
98 /* SGU: BEGIN FILE xbt/dict.c */
99 suite = xbt_test_suite_by_name("dict","Dict data container");
100 xbt_test_suite_push(suite, "basic", test_dict_basic, "Basic usage: change, retrieve, traverse");
101 xbt_test_suite_push(suite, "remove", test_dict_remove, "Removing some values");
102 xbt_test_suite_push(suite, "nulldata", test_dict_nulldata, "NULL data management");
103 xbt_test_suite_push(suite, "crash", test_dict_crash, "Crash test");
104 xbt_test_suite_push(suite, "multicrash", test_dict_multicrash, "Multi-dict crash test");
107 /* SGU: BEGIN FILE xbt/set.c */
108 suite = xbt_test_suite_by_name("set","Set data container");
109 xbt_test_suite_push(suite, "basic", test_set_basic, "Basic usage");
110 xbt_test_suite_push(suite, "change", test_set_change, "Changing some values");
111 xbt_test_suite_push(suite, "retrieve", test_set_retrieve, "Retrieving some values");
112 xbt_test_suite_push(suite, "remove", test_set_remove, "Removing some values");
115 /* SGU: BEGIN FILE xbt/swag.c */
116 suite = xbt_test_suite_by_name("swag","Swag data container");
117 xbt_test_suite_push(suite, "basic", test_swag_basic, "Basic usage");
120 /* SGU: BEGIN FILE xbt/xbt_str.c */
121 suite = xbt_test_suite_by_name("xbt_str","String Handling");
122 xbt_test_suite_push(suite, "xbt_str_split_quoted", test_split_quoted, "test the function xbt_str_split_quoted");
123 xbt_test_suite_push(suite, "xbt_str_split_str", test_split_str, "test the function xbt_str_split_str");
126 /* SGU: BEGIN FILE xbt/xbt_sha.c */
127 suite = xbt_test_suite_by_name("hash","Various hash functions");
128 xbt_test_suite_push(suite, "sha", test_crypto_sha, "Test of the sha algorithm");
131 /* SGU: BEGIN FILE xbt/config.c */
132 suite = xbt_test_suite_by_name("config","Configuration support");
133 xbt_test_suite_push(suite, "memuse", test_config_memuse, "Alloc and free a config set");
134 xbt_test_suite_push(suite, "validation", test_config_validation, "Validation tests");
135 xbt_test_suite_push(suite, "use", test_config_use, "Data retrieving tests");
138 /* SGU: END SUITES DECLARATION */
140 xbt_init(&argc,argv);
142 /* Search for the tests to do */
144 for (i=1;i<argc;i++) {
145 if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
146 char *p=strchr(argv[i],'=')+1;
147 if (selection[0] == '\0') {
148 strcpy(selection, p);
150 strcat(selection, ",");
151 strcat(selection, p);
153 } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
154 !strncmp(argv[i],"--dump", strlen("--dump"))) {
155 xbt_test_dump(selection);
157 } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
159 "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
160 "--help: display this help\n"
161 "--dump-only: don't run the tests, but display some debuging info about the tests\n"
162 "--tests=selection: Use argument to select which suites/units/tests to run\n"
163 " --tests can be used more than once, and selection may be a comma\n"
164 " separated list of directives.\n\n"
165 "Directives are of the form:\n"
166 " [-]suitename[:unitname]\n\n"
167 "If the first char is a '-', the directive disables its argument instead of enabling it\n"
168 "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
169 "it applies on any unit.\n\n"
170 "By default, everything is enabled.\n\n"
171 "'all' as suite name apply to all suites.\n\n"
172 "Example 1: \"-toto,+toto:tutu\"\n"
173 " disables the whole toto testsuite (any unit in it),\n"
174 " then reenables the tutu unit of the toto test suite.\n\n"
175 "Example 2: \"-all,+toto\"\n"
176 " Run nothing but the toto suite.\n");
179 printf("testall: Unknown option: %s\n",argv[i]);
183 /* Got all my tests to do */
185 res = xbt_test_run(selection);
189 /*******************************/
190 /* GENERATED FILE, DO NOT EDIT */
191 /*******************************/