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);
29 /* SGU: BEGIN FILE xbt/dict.c */
30 void test_dict_basic(void);
31 void test_dict_remove(void);
32 void test_dict_nulldata(void);
33 void test_dict_crash(void);
34 void test_dict_multicrash(void);
37 /* SGU: BEGIN FILE xbt/set.c */
38 void test_set_basic(void);
39 void test_set_change(void);
40 void test_set_retrieve(void);
41 void test_set_remove(void);
44 /* SGU: BEGIN FILE xbt/swag.c */
45 void test_swag_basic(void);
48 /* SGU: BEGIN FILE xbt/xbt_str.c */
49 void test_split_quoted(void);
52 /* SGU: BEGIN FILE xbt/config.c */
53 void test_config_memuse(void);
54 void test_config_validation(void);
55 void test_config_use(void);
59 /*******************************/
60 /* GENERATED FILE, DO NOT EDIT */
61 /*******************************/
63 int main(int argc, char *argv[]) {
64 xbt_test_suite_t suite;
68 /* SGU: BEGIN SUITES DECLARATION */
69 /* SGU: BEGIN FILE xbt/cunit.c */
70 suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
71 xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
74 /* SGU: BEGIN FILE xbt/ex.c */
75 suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
76 xbt_test_suite_push(suite, "controlflow", test_controlflow, "basic nested control flow");
77 xbt_test_suite_push(suite, "value", test_value, "exception value passing");
78 xbt_test_suite_push(suite, "variables", test_variables, "variable value preservation");
79 xbt_test_suite_push(suite, "cleanup", test_cleanup, "cleanup handling");
82 /* SGU: BEGIN FILE xbt/dynar.c */
83 suite = xbt_test_suite_by_name("dynar","Dynar data container");
84 xbt_test_suite_push(suite, "int", test_dynar_int, "Dyars of integers");
85 xbt_test_suite_push(suite, "double", test_dynar_double, "Dyars of doubles");
86 xbt_test_suite_push(suite, "string", test_dynar_string, "Dyars of strings");
89 /* SGU: BEGIN FILE xbt/dict.c */
90 suite = xbt_test_suite_by_name("dict","Dict data container");
91 xbt_test_suite_push(suite, "basic", test_dict_basic, "Basic usage: change, retrieve, traverse");
92 xbt_test_suite_push(suite, "remove", test_dict_remove, "Removing some values");
93 xbt_test_suite_push(suite, "nulldata", test_dict_nulldata, "NULL data management");
94 xbt_test_suite_push(suite, "crash", test_dict_crash, "Crash test");
95 xbt_test_suite_push(suite, "multicrash", test_dict_multicrash, "Multi-dict crash test");
98 /* SGU: BEGIN FILE xbt/set.c */
99 suite = xbt_test_suite_by_name("set","Set data container");
100 xbt_test_suite_push(suite, "basic", test_set_basic, "Basic usage");
101 xbt_test_suite_push(suite, "change", test_set_change, "Changing some values");
102 xbt_test_suite_push(suite, "retrieve", test_set_retrieve, "Retrieving some values");
103 xbt_test_suite_push(suite, "remove", test_set_remove, "Removing some values");
106 /* SGU: BEGIN FILE xbt/swag.c */
107 suite = xbt_test_suite_by_name("swag","Swag data container");
108 xbt_test_suite_push(suite, "basic", test_swag_basic, "Basic usage");
111 /* SGU: BEGIN FILE xbt/xbt_str.c */
112 suite = xbt_test_suite_by_name("xbt_str","String Handling");
113 xbt_test_suite_push(suite, "xbt_str_split_quoted", test_split_quoted, "test the function xbt_str_split_quoted");
116 /* SGU: BEGIN FILE xbt/config.c */
117 suite = xbt_test_suite_by_name("config","Configuration support");
118 xbt_test_suite_push(suite, "memuse", test_config_memuse, "Alloc and free a config set");
119 xbt_test_suite_push(suite, "validation", test_config_validation, "Validation tests");
120 xbt_test_suite_push(suite, "use", test_config_use, "Data retrieving tests");
123 /* SGU: END SUITES DECLARATION */
125 /* Search for the tests to do */
127 for (i=1;i<argc;i++) {
128 if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
129 char *p=strchr(argv[i],'=')+1;
130 if (selection[0] == '\0') {
131 strcpy(selection, p);
133 strcat(selection, ",");
134 strcat(selection, p);
136 } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
137 !strncmp(argv[i],"--dump", strlen("--dump"))) {
138 xbt_test_dump(selection);
140 } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
142 "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
143 "--help: display this help\n"
144 "--dump-only: don't run the tests, but display some debuging info about the tests\n"
145 "--tests=selection: Use argument to select which suites/units/tests to run\n"
146 " --tests can be used more than once, and selection may be a comma\n"
147 " separated list of directives.\n\n"
148 "Directives are of the form:\n"
149 " [-]suitename[:unitname]\n\n"
150 "If the first char is a '-', the directive disables its argument instead of enabling it\n"
151 "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
152 "it applies on any unit.\n\n"
153 "By default, everything is enabled.\n\n"
154 "'all' as suite name apply to all suites.\n\n"
155 "Example 1: \"-toto,+toto:tutu\"\n"
156 " disables the whole toto testsuite (any unit in it),\n"
157 " then reenables the tutu unit of the toto test suite.\n\n"
158 "Example 2: \"-all,+toto\"\n"
159 " Run nothing but the toto suite.\n");
162 printf("testall: Unknown option: %s\n",argv[i]);
166 /* Got all my tests to do */
168 return xbt_test_run(selection);
170 /*******************************/
171 /* GENERATED FILE, DO NOT EDIT */
172 /*******************************/