7 static void print_help(char *s)
11 printf("Usage: %s [options] [iterations [test1 test2 ... testN]]\n\n", s);
12 printf(" options are:\n");
13 printf(" --help show this help\n\n");
14 printf(" iterations: number of times to run tests\n");
15 printf(" test1..testN name of test to run (all run by default)\n\n");
16 printf(" available tests:\n");
18 for(i = 0; test_groups[i].name != NULL; i++) {
19 printf(" %s\n", test_groups[i].name);
25 gint main(gint argc, gchar **argv)
27 gint i, j, k, iterations = 1, tests_to_run_count = 0;
28 gchar **tests_to_run = NULL;
31 for(i = 1; i < argc; i++) {
32 if(strcmp(argv[i], "--help") == 0) {
38 iterations = atoi(argv[1]);
39 tests_to_run_count = argc - 2;
41 if(tests_to_run_count > 0) {
42 tests_to_run = (gchar **)g_new0(gchar *, tests_to_run_count + 1);
44 for(i = 0; i < tests_to_run_count; i++) {
45 tests_to_run[i] = argv[i + 2];
48 tests_to_run[tests_to_run_count] = NULL;
52 for(i = 0; i < iterations; i++) {
53 for(j = 0; test_groups[j].name != NULL; j++) {
56 if(tests_to_run != NULL) {
58 for(k = 0; tests_to_run[k] != NULL; k++) {
59 if(strcmp(tests_to_run[k], test_groups[j].name) == 0) {
67 run_group(&(test_groups[j]));
72 if(tests_to_run != NULL) {