46 |
struct CU_TestRegistry *reg = CU_get_registry(); |
struct CU_TestRegistry *reg = CU_get_registry(); |
47 |
struct CU_Suite *suite = reg->pSuite; |
struct CU_Suite *suite = reg->pSuite; |
48 |
struct CU_Test *test; |
struct CU_Test *test; |
49 |
|
if(suite==NULL){ |
50 |
|
fprintf(stderr,"No suites present in registry!\n"); |
51 |
|
return CUE_NO_SUITENAME; |
52 |
|
} |
53 |
|
|
54 |
CU_ErrorCode result; |
CU_ErrorCode result; |
55 |
while(suite!=NULL){ |
while(suite!=NULL){ |
56 |
fprintf(stderr,"Looking at suite %s\n", suite->pName); |
fprintf(stderr,"Looking at suite %s\n", suite->pName); |
58 |
fprintf(stderr,"Found suite %s\n", suitename); |
fprintf(stderr,"Found suite %s\n", suitename); |
59 |
if(*n=='.'){ |
if(*n=='.'){ |
60 |
++n; |
++n; |
61 |
fprintf(stderr,"Looking for test %s\n", n); |
fprintf(stderr,"Looking for test %s\n", n); |
62 |
test = suite->pTest; |
test = suite->pTest; |
63 |
while(test!=NULL){ |
while(test!=NULL){ |
64 |
fprintf(stderr,"Found test %s\n", test->pName); |
fprintf(stderr,"Found test %s\n", test->pName); |
65 |
if(0==strcmp(test->pName,n)){ |
if(0==strcmp(test->pName,n)){ |
66 |
fprintf(stderr,"Running test %s (%p, %p)\n", n,suite,test); |
fprintf(stderr,"Running test %s (%p, %p)\n", n,suite,test); |
67 |
result = CU_basic_run_test(suite,test); |
result = CU_basic_run_test(suite,test); |
68 |
fprintf(stderr,"Result: %s\n",CU_get_error_msg()); |
fprintf(stderr,"Result: %s\n",CU_get_error_msg()); |
69 |
return result; |
return result; |
76 |
result = CU_basic_run_suite(suite); |
result = CU_basic_run_suite(suite); |
77 |
fprintf(stderr,"Result: %s\n",CU_get_error_msg()); |
fprintf(stderr,"Result: %s\n",CU_get_error_msg()); |
78 |
return result; |
return result; |
79 |
} |
} |
80 |
} |
} |
81 |
suite = suite->pNext; |
suite = suite->pNext; |
82 |
} |
} |
104 |
/* getopt_long stores the option index here. */ |
/* getopt_long stores the option index here. */ |
105 |
int option_index = 0; |
int option_index = 0; |
106 |
|
|
107 |
const char *usage = |
const char *usage = |
108 |
"%s -vsne [SuiteName|SuiteName.testname] ...\n" |
"%s -vsne [SuiteName|SuiteName.testname] ...\n" |
109 |
"Test ASCEND base/generic routines\n" |
"Test ASCEND base/generic routines\n" |
110 |
"options:\n" |
"options:\n" |
132 |
error_action = CUEA_IGNORE; |
error_action = CUEA_IGNORE; |
133 |
} |
} |
134 |
else{ |
else{ |
135 |
fprintf(stderr,"Invalid argument for --on-error option!\n"); |
fprintf(stderr,"Invalid argument for --on-error option!\n"); |
136 |
exit(1); |
exit(1); |
137 |
} |
} |
138 |
break; |
break; |
163 |
fprintf(stderr,"Invalid test name '%s'\n", argv[optind]); |
fprintf(stderr,"Invalid test name '%s'\n", argv[optind]); |
164 |
exit(1); |
exit(1); |
165 |
} |
} |
166 |
optind++; |
optind++; |
167 |
} |
} |
168 |
}else{ |
}else{ |
169 |
result = CU_basic_run_tests(); |
result = CU_basic_run_tests(); |