1 /*******************************/
2 /* GENERATED FILE, DO NOT EDIT */
3 /*******************************/
7 extern xbt_test_unit_t _xbt_current_unit;
9 /* SGU: BEGIN PROTOTYPES */
10 /* SGU: BEGIN FILE xbt/cunit.c */
11 void test_expected_failure(void);
14 /* SGU: BEGIN FILE xbt/ex.c */
15 void test_controlflow(void);
16 void test_value(void);
17 void test_variables(void);
18 void test_cleanup(void);
21 /* SGU: BEGIN FILE xbt/dynar.c */
22 void test_dynar_int(void);
23 void test_dynar_double(void);
24 void test_dynar_string(void);
27 /* SGU: BEGIN FILE xbt/dict.c */
28 void test_dict_basic(void);
29 void test_dict_remove(void);
30 void test_dict_nulldata(void);
31 void test_dict_crash(void);
32 void test_dict_multicrash(void);
35 /* SGU: BEGIN FILE xbt/set.c */
36 void test_set_basic(void);
37 void test_set_change(void);
38 void test_set_retrieve(void);
39 void test_set_remove(void);
42 /* SGU: BEGIN FILE xbt/swag.c */
43 void test_swag_basic(void);
46 /* SGU: BEGIN FILE xbt/config.c */
47 void test_config_memuse(void);
48 void test_config_validation(void);
49 void test_config_use(void);
53 /*******************************/
54 /* GENERATED FILE, DO NOT EDIT */
55 /*******************************/
57 int main(int argc, char *argv[]) {
58 xbt_test_suite_t suite;
62 /* SGU: BEGIN SUITES DECLARATION */
63 /* SGU: BEGIN FILE xbt/cunit.c */
64 suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
65 xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
68 /* SGU: BEGIN FILE xbt/ex.c */
69 suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
70 xbt_test_suite_push(suite, "controlflow", test_controlflow, "basic nested control flow");
71 xbt_test_suite_push(suite, "value", test_value, "exception value passing");
72 xbt_test_suite_push(suite, "variables", test_variables, "variable value preservation");
73 xbt_test_suite_push(suite, "cleanup", test_cleanup, "cleanup handling");
76 /* SGU: BEGIN FILE xbt/dynar.c */
77 suite = xbt_test_suite_by_name("dynar","Dynar data container");
78 xbt_test_suite_push(suite, "int", test_dynar_int, "Dyars of integers");
79 xbt_test_suite_push(suite, "double", test_dynar_double, "Dyars of doubles");
80 xbt_test_suite_push(suite, "string", test_dynar_string, "Dyars of strings");
83 /* SGU: BEGIN FILE xbt/dict.c */
84 suite = xbt_test_suite_by_name("dict","Dict data container");
85 xbt_test_suite_push(suite, "basic", test_dict_basic, "Basic usage: change, retrieve, traverse");
86 xbt_test_suite_push(suite, "remove", test_dict_remove, "Removing some values");
87 xbt_test_suite_push(suite, "nulldata", test_dict_nulldata, "NULL data management");
88 xbt_test_suite_push(suite, "crash", test_dict_crash, "Crash test");
89 xbt_test_suite_push(suite, "multicrash", test_dict_multicrash, "Multi-dict crash test");
92 /* SGU: BEGIN FILE xbt/set.c */
93 suite = xbt_test_suite_by_name("set","Set data container");
94 xbt_test_suite_push(suite, "basic", test_set_basic, "Basic usage");
95 xbt_test_suite_push(suite, "change", test_set_change, "Changing some values");
96 xbt_test_suite_push(suite, "retrieve", test_set_retrieve, "Retrieving some values");
97 xbt_test_suite_push(suite, "remove", test_set_remove, "Removing some values");
100 /* SGU: BEGIN FILE xbt/swag.c */
101 suite = xbt_test_suite_by_name("swag","Swag data container");
102 xbt_test_suite_push(suite, "basic", test_swag_basic, "Basic usage");
105 /* SGU: BEGIN FILE xbt/config.c */
106 suite = xbt_test_suite_by_name("config","Configuration support");
107 xbt_test_suite_push(suite, "memuse", test_config_memuse, "Alloc and free a config set");
108 xbt_test_suite_push(suite, "validation", test_config_validation, "Validation tests");
109 xbt_test_suite_push(suite, "use", test_config_use, "Data retrieving tests");
112 /* SGU: END SUITES DECLARATION */
114 /* Search for the tests to do */
116 for (i=1;i<argc;i++) {
117 if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
118 char *p=strchr(argv[i],'=')+1;
119 if (selection[0] == '\0') {
120 strcpy(selection, p);
122 strcat(selection, ",");
123 strcat(selection, p);
125 } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
126 !strncmp(argv[i],"--dump", strlen("--dump"))) {
127 xbt_test_dump(selection);
129 } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
131 "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
132 "--help: display this help\n"
133 "--dump-only: don't run the tests, but display some debuging info about the tests\n"
134 "--tests=selection: Use argument to select which suites/units/tests to run\n"
135 " --tests can be used more than once, and selection may be a comma\n"
136 " separated list of directives.\n\n"
137 "Directives are of the form:\n"
138 " [-]suitename[:unitname]\n\n"
139 "If the first char is a '-', the directive disables its argument instead of enabling it\n"
140 "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
141 "it applies on any unit.\n\n"
142 "By default, everything is enabled.\n\n"
143 "'all' as suite name apply to all suites.\n\n"
144 "Example 1: \"-toto,+toto:tutu\"\n"
145 " disables the whole toto testsuite (any unit in it),\n"
146 " then reenables the tutu unit of the toto test suite.\n\n"
147 "Example 2: \"-all,+toto\"\n"
148 " Run nothing but the toto suite.\n");
151 printf("testall: Unknown option: %s\n",argv[i]);
155 /* Got all my tests to do */
157 return xbt_test_run(selection);
159 /*******************************/
160 /* GENERATED FILE, DO NOT EDIT */
161 /*******************************/