Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adding very hacked together and inefficient implementation of mpi_comm_world.
[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: END PROTOTYPES */
17
18 /*******************************/
19 /* GENERATED FILE, DO NOT EDIT */
20 /*******************************/
21
22 int main(int argc, char *argv[]) {
23   xbt_test_suite_t suite; 
24   char selection[1024];
25   int i;
26
27   /* SGU: BEGIN SUITES DECLARATION */
28     /* SGU: BEGIN FILE ./xbt/cunit.c */
29       suite = xbt_test_suite_by_name("cunit","Testsuite mechanism autotest");
30       xbt_test_suite_push(suite, "expect", test_expected_failure, "expected failures");
31     /* SGU: END FILE */
32
33   /* SGU: END SUITES DECLARATION */
34       
35   xbt_init(&argc,argv);
36     
37   /* Search for the tests to do */
38     selection[0]='\0';
39     for (i=1;i<argc;i++) {
40       if (!strncmp(argv[i],"--tests=",strlen("--tests="))) {
41         char *p=strchr(argv[i],'=')+1;
42         if (selection[0] == '\0') {
43           strcpy(selection, p);
44         } else {
45           strcat(selection, ",");
46           strcat(selection, p);
47         }
48       } else if (!strncmp(argv[i],"--dump-only",strlen("--dump-only"))||
49                  !strncmp(argv[i],"--dump",     strlen("--dump"))) {
50         xbt_test_dump(selection);
51         return 0;
52       } else if (!strncmp(argv[i],"--help",strlen("--help"))) {
53           printf(
54               "Usage: testall [--help] [--tests=selection] [--dump-only]\n\n"
55               "--help: display this help\n"
56               "--dump-only: don't run the tests, but display some debuging info about the tests\n"
57               "--tests=selection: Use argument to select which suites/units/tests to run\n"
58               "                   --tests can be used more than once, and selection may be a comma\n"
59               "                   separated list of directives.\n\n"
60               "Directives are of the form:\n"
61               "   [-]suitename[:unitname]\n\n"
62               "If the first char is a '-', the directive disables its argument instead of enabling it\n"
63               "suitename/unitname is the set of tests to en/disable. If a unitname is not specified,\n"
64               "it applies on any unit.\n\n"
65               "By default, everything is enabled.\n\n"
66               "'all' as suite name apply to all suites.\n\n"
67               "Example 1: \"-toto,+toto:tutu\"\n"
68               "  disables the whole toto testsuite (any unit in it),\n"
69               "  then reenables the tutu unit of the toto test suite.\n\n"
70               "Example 2: \"-all,+toto\"\n"
71               "  Run nothing but the toto suite.\n");
72           return 0;
73       } else {
74         printf("testall: Unknown option: %s\n",argv[i]);
75         return 1;
76       }
77     }
78   /* Got all my tests to do */
79       
80   return xbt_test_run(selection);
81 }
82 /*******************************/
83 /* GENERATED FILE, DO NOT EDIT */
84 /*******************************/
85