You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rb...@apache.org on 2002/10/24 01:28:12 UTC

cvs commit: apr/test CuTest.c CuTest.h testall.c

rbb         2002/10/23 16:28:12

  Modified:    test     CuTest.c CuTest.h testall.c
  Log:
  Cleanup the output from the new test suite.  It now prints the output
  as the tests are run.
  
  Revision  Changes    Path
  1.6       +19 -1     apr/test/CuTest.c
  
  Index: CuTest.c
  ===================================================================
  RCS file: /home/cvs/apr/test/CuTest.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CuTest.c	13 Oct 2002 02:54:23 -0000	1.5
  +++ CuTest.c	23 Oct 2002 23:28:12 -0000	1.6
  @@ -279,7 +279,6 @@
   void CuSuiteSummary(CuSuite* testSuite, CuString* summary)
   {
   	int i;
  -	CuStringAppendFormat(summary, "%s:\t", testSuite->name);
   	for (i = 0 ; i < testSuite->count ; ++i)
   	{
   		CuTest* testCase = testSuite->list[i];
  @@ -362,6 +361,25 @@
   		CuSuite* testCase = testSuite->list[i];
   		CuSuiteRun(testCase);
   	}
  +}
  +
  +void CuSuiteListRunWithSummary(CuSuiteList* testSuite)
  +{
  +	int i;
  +
  +	printf("%s:\n", testSuite->name);
  +	for (i = 0 ; i < testSuite->count ; ++i)
  +	{
  +		CuSuite* testCase = testSuite->list[i];
  +		CuString *str = CuStringNew();
  +
  +	        printf("%s:\t", testCase->name);
  +		CuSuiteRun(testCase);
  +		CuSuiteSummary(testCase, str);
  +		printf("    %s", str->buffer);
  +
  +	}
  +	printf("\n");
   }
   
   void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary)
  
  
  
  1.5       +1 -0      apr/test/CuTest.h
  
  Index: CuTest.h
  ===================================================================
  RCS file: /home/cvs/apr/test/CuTest.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CuTest.h	13 Oct 2002 02:19:15 -0000	1.4
  +++ CuTest.h	23 Oct 2002 23:28:12 -0000	1.5
  @@ -128,6 +128,7 @@
   CuSuiteList* CuSuiteListNew(char* name);
   void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase);
   void CuSuiteListRun(CuSuiteList* testSuite);
  +void CuSuiteListRunWithSummary(CuSuiteList* testSuite);
   void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary);
   void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details);
   #endif /* CU_TEST_H */
  
  
  
  1.10      +1 -2      apr/test/testall.c
  
  Index: testall.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testall.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- testall.c	22 Oct 2002 23:22:06 -0000	1.9
  +++ testall.c	23 Oct 2002 23:28:12 -0000	1.10
  @@ -93,8 +93,7 @@
           CuSuiteListAdd(alltests, tests[i]());
       }
   
  -    CuSuiteListRun(alltests);
  -    CuSuiteListSummary(alltests, output);
  +    CuSuiteListRunWithSummary(alltests);
       CuSuiteListDetails(alltests, output);
       printf("%s\n", output->buffer);
       return 0;