Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ff18a51eaf8208c63b620e9030e1cf190d4f549e
[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   /* SGU: END FILE */
28
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);
35   /* SGU: END FILE */
36
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);
42   /* SGU: END FILE */
43
44   /* SGU: BEGIN FILE xbt/swag.c */
45     void test_swag_basic(void);
46   /* SGU: END FILE */
47
48   /* SGU: BEGIN FILE xbt/xbt_str.c */
49     void test_split_quoted(void);
50   /* SGU: END FILE */
51
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);
56   /* SGU: END FILE */
57
58
59 /*******************************/
60 /* GENERATED FILE, DO NOT EDIT */
61 /*******************************/
62
63 int main(int argc, char *argv[]) {
64   xbt_test_suite_t suite; 
65   char selection[1024];
66   int i;
67
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");
72     /* SGU: END FILE */
73
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");
80     /* SGU: END FILE */
81
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");
87     /* SGU: END FILE */
88
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");
96     /* SGU: END FILE */
97
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");
104     /* SGU: END FILE */
105
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");
109     /* SGU: END FILE */
110
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");
114     /* SGU: END FILE */
115
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");
121     /* SGU: END FILE */
122
123   /* SGU: END SUITES DECLARATION */
124       
125   /* Search for the tests to do */
126     selection[0]='\0';
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);
132         } else {
133           strcat(selection, ",");
134           strcat(selection, p);
135         }
136       } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
137                  !strncmp(argv[i],"--dump",     strlen("--dump"))) {
138         xbt_test_dump(selection);
139         return 0;
140       } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
141           printf(
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");
160           return 0;
161       } else {
162         printf("testall: Unknown option: %s\n",argv[i]);
163         return 1;
164       }
165     }
166   /* Got all my tests to do */
167       
168   return xbt_test_run(selection);
169 }
170 /*******************************/
171 /* GENERATED FILE, DO NOT EDIT */
172 /*******************************/
173