Test.m
changeset 2 3d3dcc3116d5
parent 0 d84d25d6cdbb
child 10 82a37ccf6b8c
     1.1 --- a/Test.m	Sat Mar 08 21:04:41 2008 -0800
     1.2 +++ b/Test.m	Wed Apr 02 14:45:33 2008 -0700
     1.3 @@ -11,11 +11,15 @@
     1.4  
     1.5  #if DEBUG
     1.6  
     1.7 +BOOL gRunningTestCase;
     1.8 +
     1.9  struct TestCaseLink *gAllTestCases;
    1.10  static int sPassed, sFailed;
    1.11  
    1.12  static BOOL RunTestCase( struct TestCaseLink *test )
    1.13  {
    1.14 +    BOOL oldLogging = EnableLog(YES);
    1.15 +    gRunningTestCase = YES;
    1.16      if( test->testptr ) {
    1.17          NSAutoreleasePool *pool = [NSAutoreleasePool new];
    1.18          Log(@"=== Testing %s ...",test->name);
    1.19 @@ -37,6 +41,8 @@
    1.20              test->testptr = NULL;       // prevents test from being run again
    1.21          }
    1.22      }
    1.23 +    gRunningTestCase = NO;
    1.24 +    EnableLog(oldLogging);
    1.25      return test->passed;
    1.26  }
    1.27  
    1.28 @@ -63,7 +69,6 @@
    1.29  
    1.30  void RunTestCases( int argc, const char **argv )
    1.31  {
    1.32 -    gShouldLog = YES;
    1.33      sPassed = sFailed = 0;
    1.34      BOOL stopAfterTests = NO;
    1.35      for( int i=1; i<argc; i++ ) {