Logo AND Algorithmique Numérique Distribuée

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