Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Test that insert/replace/remove functions of dynars are working (and fix insert when...
[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_insert(void);
26     void  test_dynar_double(void);
27     void  test_dynar_string(void);
28     void  test_dynar_sync_int(void);
29   /* SGU: END FILE */
30
31   /* SGU: BEGIN FILE xbt/dict.c */
32     void  test_dict_basic(void);
33     void  test_dict_remove(void);
34     void  test_dict_nulldata(void);
35     void  test_dict_scalar(void);
36     void  test_dict_crash(void);
37     void  test_dict_multicrash(void);
38   /* SGU: END FILE */
39
40   /* SGU: BEGIN FILE xbt/set.c */
41     void  test_set_basic(void);
42     void  test_set_change(void);
43     void  test_set_retrieve(void);
44     void  test_set_remove(void);
45   /* SGU: END FILE */
46
47   /* SGU: BEGIN FILE xbt/swag.c */
48     void  test_swag_basic(void);
49   /* SGU: END FILE */
50
51   /* SGU: BEGIN FILE xbt/xbt_str.c */
52     void  test_split_quoted(void);
53     void  test_split_str(void);
54   /* SGU: END FILE */
55
56   /* SGU: BEGIN FILE xbt/xbt_strbuff.c */
57     void  test_strbuff_substitute(void);
58   /* SGU: END FILE */
59
60   /* SGU: BEGIN FILE xbt/xbt_sha.c */
61     void  test_crypto_sha(void);
62   /* SGU: END FILE */
63
64   /* SGU: BEGIN FILE xbt/config.c */
65     void  test_config_memuse(void);
66     void  test_config_validation(void);
67     void  test_config_use(void);
68   /* SGU: END FILE */
69
70   /* SGU: BEGIN FILE xbt/xbt_synchro.c */
71     void  test_dynar_dopar(void);
72   /* SGU: END FILE */
73
74
75 /*******************************/
76 /* GENERATED FILE, DO NOT EDIT */
77 /*******************************/
78
79 int main(int argc, char *argv[]) {
80   xbt_test_suite_t suite; 
81   char selection[1024];
82   int i;
83
84   int res;
85
86   /* SGU: BEGIN SUITES DECLARATION */
87     /* SGU: BEGIN FILE xbt/cunit.c */
88       suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
89       xbt_test_suite_push(suite, "expect",  test_expected_failure,  "expected failures");
90     /* SGU: END FILE */
91
92     /* SGU: BEGIN FILE xbt/ex.c */
93       suite = xbt_test_suite_by_name("xbt_ex","Exception Handling");
94       xbt_test_suite_push(suite, "controlflow",  test_controlflow,  "basic nested control flow");
95       xbt_test_suite_push(suite, "value",  test_value,  "exception value passing");
96       xbt_test_suite_push(suite, "variables",  test_variables,  "variable value preservation");
97       xbt_test_suite_push(suite, "cleanup",  test_cleanup,  "cleanup handling");
98     /* SGU: END FILE */
99
100     /* SGU: BEGIN FILE xbt/dynar.c */
101       suite = xbt_test_suite_by_name("dynar","Dynar data container");
102       xbt_test_suite_push(suite, "int",  test_dynar_int,  "Dynars of integers");
103       xbt_test_suite_push(suite, "insert", test_dynar_insert, "Using the xbt_dynar_insert and xbt_dynar_remove functions");
104       xbt_test_suite_push(suite, "double",  test_dynar_double,  "Dynars of doubles");
105       xbt_test_suite_push(suite, "string",  test_dynar_string,  "Dynars of strings");
106       xbt_test_suite_push(suite, "synchronized int",  test_dynar_sync_int,  "Synchronized dynars of integers");
107     /* SGU: END FILE */
108
109     /* SGU: BEGIN FILE xbt/dict.c */
110       suite = xbt_test_suite_by_name("dict","Dict data container");
111       xbt_test_suite_push(suite, "basic",  test_dict_basic,  "Basic usage: change, retrieve, traverse");
112       xbt_test_suite_push(suite, "remove",  test_dict_remove,  "Removing some values");
113       xbt_test_suite_push(suite, "nulldata",  test_dict_nulldata,  "NULL data management");
114       xbt_test_suite_push(suite, "dicti",  test_dict_scalar,  "Scalar data and key management");
115       xbt_test_suite_push(suite, "crash",  test_dict_crash,  "Crash test");
116       xbt_test_suite_push(suite, "multicrash",  test_dict_multicrash,  "Multi-dict crash test");
117     /* SGU: END FILE */
118
119     /* SGU: BEGIN FILE xbt/set.c */
120       suite = xbt_test_suite_by_name("set","Set data container");
121       xbt_test_suite_push(suite, "basic",  test_set_basic,  "Basic usage");
122       xbt_test_suite_push(suite, "change",  test_set_change,  "Changing some values");
123       xbt_test_suite_push(suite, "retrieve",  test_set_retrieve,  "Retrieving some values");
124       xbt_test_suite_push(suite, "remove",  test_set_remove,  "Removing some values");
125     /* SGU: END FILE */
126
127     /* SGU: BEGIN FILE xbt/swag.c */
128       suite = xbt_test_suite_by_name("swag","Swag data container");
129       xbt_test_suite_push(suite, "basic",  test_swag_basic,  "Basic usage");
130     /* SGU: END FILE */
131
132     /* SGU: BEGIN FILE xbt/xbt_str.c */
133       suite = xbt_test_suite_by_name("xbt_str","String Handling");
134       xbt_test_suite_push(suite, "xbt_str_split_quoted",  test_split_quoted,  "test the function xbt_str_split_quoted");
135       xbt_test_suite_push(suite, "xbt_str_split_str",  test_split_str,  "test the function xbt_str_split_str");
136     /* SGU: END FILE */
137
138     /* SGU: BEGIN FILE xbt/xbt_strbuff.c */
139       suite = xbt_test_suite_by_name("xbt_strbuff","String Buffers");
140       xbt_test_suite_push(suite, "xbt_strbuff_substitute",  test_strbuff_substitute,  "test the function xbt_strbuff_substitute");
141     /* SGU: END FILE */
142
143     /* SGU: BEGIN FILE xbt/xbt_sha.c */
144       suite = xbt_test_suite_by_name("hash","Various hash functions");
145       xbt_test_suite_push(suite, "sha",  test_crypto_sha,  "Test of the sha algorithm");
146     /* SGU: END FILE */
147
148     /* SGU: BEGIN FILE xbt/config.c */
149       suite = xbt_test_suite_by_name("config","Configuration support");
150       xbt_test_suite_push(suite, "memuse",  test_config_memuse,  "Alloc and free a config set");
151       xbt_test_suite_push(suite, "validation",  test_config_validation,  "Validation tests");
152       xbt_test_suite_push(suite, "use",  test_config_use,  "Data retrieving tests");
153     /* SGU: END FILE */
154
155     /* SGU: BEGIN FILE xbt/xbt_synchro.c */
156       suite = xbt_test_suite_by_name("synchro","Advanced synchronization mecanisms");
157       xbt_test_suite_push(suite, "dopar",  test_dynar_dopar,  "do parallel on dynars of integers");
158     /* SGU: END FILE */
159
160   /* SGU: END SUITES DECLARATION */
161       
162   xbt_init(&argc,argv);
163     
164   /* Search for the tests to do */
165     selection[0]='\0';
166     for (i=1;i<argc;i++) {
167       if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
168         char *p=strchr(argv[i],'=')+1;
169         if (selection[0] == '\0') {
170           strcpy(selection, p);
171         } else {
172           strcat(selection, ",");
173           strcat(selection, p);
174         }
175       } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
176                  !strncmp(argv[i],"--dump",     strlen("--dump"))) {
177         xbt_test_dump(selection);
178         return 0;
179       } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
180           printf(
181               "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
182               "--help: display this help\n"
183               "--dump-only: don't run the tests, but display some debuging info about the tests\n"
184               "--tests=selection: Use argument to select which suites/units/tests to run\n"
185               "                   --tests can be used more than once, and selection may be a comma\n"
186               "                   separated list of directives.\n\n"
187               "Directives are of the form:\n"
188               "   [-]suitename[:unitname]\n\n"
189               "If the first char is a '-', the directive disables its argument instead of enabling it\n"
190               "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
191               "it applies on any unit.\n\n"
192               "By default, everything is enabled.\n\n"
193               "'all' as suite name apply to all suites.\n\n"
194               "Example 1: \"-toto,+toto:tutu\"\n"
195               "  disables the whole toto testsuite (any unit in it),\n"
196               "  then reenables the tutu unit of the toto test suite.\n\n"
197               "Example 2: \"-all,+toto\"\n"
198               "  Run nothing but the toto suite.\n");
199           return 0;
200       } else {
201         printf("testall: Unknown option: %s\n",argv[i]);
202         return 1;
203       }
204     }
205   /* Got all my tests to do */
206       
207   res = xbt_test_run(selection);
208   xbt_test_exit();
209   return res;
210 }
211 /*******************************/
212 /* GENERATED FILE, DO NOT EDIT */
213 /*******************************/
214