Logo AND Algorithmique Numérique Distribuée

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