Logo AND Algorithmique Numérique Distribuée

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