/[ascend]/trunk/base/generic/test/test.c
ViewVC logotype

Diff of /trunk/base/generic/test/test.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1001 by johnpye, Sun Dec 24 01:33:59 2006 UTC revision 1002 by johnpye, Sat Dec 30 14:27:47 2006 UTC
# Line 60  int run_suite_or_test(char *name){ Line 60  int run_suite_or_test(char *name){
60                      if(0==strcmp(test->pName,n)){                      if(0==strcmp(test->pName,n)){
61                          fprintf(stderr,"Running test %s (%p, %p)\n", n,suite,test);                                  fprintf(stderr,"Running test %s (%p, %p)\n", n,suite,test);        
62                          result = CU_basic_run_test(suite,test);                          result = CU_basic_run_test(suite,test);
                         fprintf(stderr,"Result = %d\n",result);  
63                          fprintf(stderr,"Result: %s\n",CU_get_error_msg());                          fprintf(stderr,"Result: %s\n",CU_get_error_msg());
64                          return result;                          return result;
65                      }                      }
# Line 70  int run_suite_or_test(char *name){ Line 69  int run_suite_or_test(char *name){
69              }else{              }else{
70                  fprintf(stderr,"Running suite %s (%p)\n",suitename,suite);                  fprintf(stderr,"Running suite %s (%p)\n",suitename,suite);
71                  result = CU_basic_run_suite(suite);                  result = CU_basic_run_suite(suite);
                 fprintf(stderr,"Result = %d\n",result);  
72                  fprintf(stderr,"Result: %s\n",CU_get_error_msg());                  fprintf(stderr,"Result: %s\n",CU_get_error_msg());
73                  return result;                  return result;
74              }                }  
# Line 118  int main(int argc, char* argv[]){ Line 116  int main(int argc, char* argv[]){
116              case 's': mode = CU_BRM_SILENT; break;              case 's': mode = CU_BRM_SILENT; break;
117              case 'n': mode = CU_BRM_NORMAL; break;              case 'n': mode = CU_BRM_NORMAL; break;
118              case 'e':              case 'e':
119                  fprintf(stderr,"Got option 'e'\n"); exit(1);                  if(0==strcmp(optarg,"fail")){
120                  if(0==strcmp(optarg,"fail")) error_action = CUEA_FAIL;                      fprintf(stderr,"on error FAIL\n");
121                  else if(0==strcmp(optarg,"abort")) error_action = CUEA_ABORT;                      error_action = CUEA_FAIL;
122                  else if(0==strcmp(optarg,"ignore")) error_action = CUEA_IGNORE;                  }else if(0==strcmp(optarg,"abort")){
123                  else fprintf(stderr,"Invalid argument for --on-error option!\n"); exit(1);                      fprintf(stderr,"on error ABORT\n");
124                        error_action = CUEA_ABORT;
125                        break;
126                    }else if(0==strcmp(optarg,"ignore")){
127                        error_action = CUEA_IGNORE;
128                    }
129                    else{
130                        fprintf(stderr,"Invalid argument for --on-error option!\n");
131                        exit(1);
132                    }
133                  break;                  break;
134              case '?':              case '?':
135              case 'h':              case 'h':
# Line 161  int main(int argc, char* argv[]){ Line 168  int main(int argc, char* argv[]){
168    
169      if(mode == CU_BRM_VERBOSE)ascshutdown("Testing completed.");/* shut down memory manager */      if(mode == CU_BRM_VERBOSE)ascshutdown("Testing completed.");/* shut down memory manager */
170    
     fprintf(stderr,"RETURN CODE = %d\n", result);  
171      return result;      return result;
172  }  }

Legend:
Removed from v.1001  
changed lines
  Added in v.1002

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22