Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
memleak
[simgrid.git] / src / simgrid_units_main.c
1 /*******************************/
2 /* GENERATED FILE, DO NOT EDIT */
3 /*******************************/
4
5 #include <stdio.h>
6
7 #include "xbt.h"
8
9 extern xbt_test_unit_t _xbt_current_unit;
10
11 /* SGU: BEGIN PROTOTYPES */
12   /* SGU: BEGIN FILE xbt/cunit.c */
13     void test_expected_failure(void);
14   /* SGU: END FILE */
15
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);
21   /* SGU: END FILE */
22
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);
28   /* SGU: END FILE */
29
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);
36   /* SGU: END FILE */
37
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);
43   /* SGU: END FILE */
44
45   /* SGU: BEGIN FILE xbt/swag.c */
46     void test_swag_basic(void);
47   /* SGU: END FILE */
48
49   /* SGU: BEGIN FILE xbt/xbt_str.c */
50     void test_split_quoted(void);
51   /* SGU: END FILE */
52
53   /* SGU: BEGIN FILE xbt/config.c */
54     void test_config_memuse(void);
55     void test_config_validation(void);
56     void test_config_use(void);
57   /* SGU: END FILE */
58
59
60 /*******************************/
61 /* GENERATED FILE, DO NOT EDIT */
62 /*******************************/
63
64 int main(int argc, char *argv[]) {
65   xbt_test_suite_t suite; 
66   char selection[1024];
67   int i;
68
69   /* SGU: BEGIN SUITES DECLARATION */
70     /* SGU: BEGIN FILE xbt/cunit.c */
71       suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
72       xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
73     /* SGU: END FILE */
74
75     /* SGU: BEGIN FILE xbt/ex.c */
76       suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
77       xbt_test_suite_push(suite, "controlflow", test_controlflow,  "basic nested control flow");
78       xbt_test_suite_push(suite, "value", test_value, "exception value passing");
79       xbt_test_suite_push(suite, "variables", test_variables, "variable value preservation");
80       xbt_test_suite_push(suite, "cleanup", test_cleanup, "cleanup handling");
81     /* SGU: END FILE */
82
83     /* SGU: BEGIN FILE xbt/dynar.c */
84       suite = xbt_test_suite_by_name("dynar","Dynar data container");
85       xbt_test_suite_push(suite, "int", test_dynar_int, "Dynars of integers");
86       xbt_test_suite_push(suite, "double", test_dynar_double, "Dynars of doubles");
87       xbt_test_suite_push(suite, "string", test_dynar_string, "Dyars of strings");
88       xbt_test_suite_push(suite, "synchronized int", test_dynar_sync_int, "Synchronized dynars of integers");
89     /* SGU: END FILE */
90
91     /* SGU: BEGIN FILE xbt/dict.c */
92       suite = xbt_test_suite_by_name("dict","Dict data container");
93       xbt_test_suite_push(suite, "basic", test_dict_basic, "Basic usage: change, retrieve, traverse");
94       xbt_test_suite_push(suite, "remove", test_dict_remove, "Removing some values");
95       xbt_test_suite_push(suite, "nulldata", test_dict_nulldata, "NULL data management");
96       xbt_test_suite_push(suite, "crash", test_dict_crash, "Crash test");
97       xbt_test_suite_push(suite, "multicrash", test_dict_multicrash, "Multi-dict crash test");
98     /* SGU: END FILE */
99
100     /* SGU: BEGIN FILE xbt/set.c */
101       suite = xbt_test_suite_by_name("set","Set data container");
102       xbt_test_suite_push(suite, "basic", test_set_basic, "Basic usage");
103       xbt_test_suite_push(suite, "change", test_set_change, "Changing some values");
104       xbt_test_suite_push(suite, "retrieve", test_set_retrieve, "Retrieving some values");
105       xbt_test_suite_push(suite, "remove", test_set_remove, "Removing some values");
106     /* SGU: END FILE */
107
108     /* SGU: BEGIN FILE xbt/swag.c */
109       suite = xbt_test_suite_by_name("swag","Swag data container");
110       xbt_test_suite_push(suite, "basic", test_swag_basic, "Basic usage");
111     /* SGU: END FILE */
112
113     /* SGU: BEGIN FILE xbt/xbt_str.c */
114       suite = xbt_test_suite_by_name("xbt_str","String Handling");
115       xbt_test_suite_push(suite, "xbt_str_split_quoted", test_split_quoted,  "test the function xbt_str_split_quoted");
116     /* SGU: END FILE */
117
118     /* SGU: BEGIN FILE xbt/config.c */
119       suite = xbt_test_suite_by_name("config","Configuration support");
120       xbt_test_suite_push(suite, "memuse", test_config_memuse, "Alloc and free a config set");
121       xbt_test_suite_push(suite, "validation", test_config_validation, "Validation tests");
122       xbt_test_suite_push(suite, "use", test_config_use, "Data retrieving tests");
123     /* SGU: END FILE */
124
125   /* SGU: END SUITES DECLARATION */
126       
127   xbt_init(&argc,argv);
128     
129   /* Search for the tests to do */
130     selection[0]='\0';
131     for (i=1;i<argc;i++) {
132       if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
133         char *p=strchr(argv[i],'=')+1;
134         if (selection[0] == '\0') {
135           strcpy(selection, p);
136         } else {
137           strcat(selection, ",");
138           strcat(selection, p);
139         }
140       } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
141                  !strncmp(argv[i],"--dump",     strlen("--dump"))) {
142         xbt_test_dump(selection);
143         return 0;
144       } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
145           printf(
146               "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
147               "--help: display this help\n"
148               "--dump-only: don't run the tests, but display some debuging info about the tests\n"
149               "--tests=selection: Use argument to select which suites/units/tests to run\n"
150               "                   --tests can be used more than once, and selection may be a comma\n"
151               "                   separated list of directives.\n\n"
152               "Directives are of the form:\n"
153               "   [-]suitename[:unitname]\n\n"
154               "If the first char is a '-', the directive disables its argument instead of enabling it\n"
155               "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
156               "it applies on any unit.\n\n"
157               "By default, everything is enabled.\n\n"
158               "'all' as suite name apply to all suites.\n\n"
159               "Example 1: \"-toto,+toto:tutu\"\n"
160               "  disables the whole toto testsuite (any unit in it),\n"
161               "  then reenables the tutu unit of the toto test suite.\n\n"
162               "Example 2: \"-all,+toto\"\n"
163               "  Run nothing but the toto suite.\n");
164           return 0;
165       } else {
166         printf("testall: Unknown option: %s\n",argv[i]);
167         return 1;
168       }
169     }
170   /* Got all my tests to do */
171       
172   return xbt_test_run(selection);
173 }
174 /*******************************/
175 /* GENERATED FILE, DO NOT EDIT */
176 /*******************************/
177