Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3421

Show
Ignore:
Timestamp:
04/09/08 13:05:34 (8 months ago)
Author:
larsivi
Message:

Somewhat improved reporting.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/unittest.sh

    r3202 r3421  
    5151bool tangoUnitTester() 
    5252{ 
    53     uint count = 0; 
     53    uint countFailed = 0; 
     54    uint countTotal = 1; 
    5455    Stdout ("NOTE: This is still fairly rudimentary, and will only report the").newline; 
    5556    Stdout ("    first error per module.").newline; 
     
    5758    { 
    5859        if ( m.unitTest) { 
    59             Stdout.format ("{}. Executing unittests in '{}' ", count, m.name); 
     60            Stdout.format ("{}. Executing unittests in '{}' ", countTotal, m.name); 
    6061            try { 
    6162               m.unitTest(); 
    6263            } 
    6364            catch (Exception e) { 
     65                countFailed++; 
    6466                Stdout(" - Unittest failed.").newline; 
    6567                Stdout.format("   File '{}', line '{}'.", e.file, e.line).newline; 
     
    7072            } 
    7173            Stdout(" - Success.").newline; 
    72             count++; 
     74            countTotal++; 
    7375        } 
    7476    } 
     77 
     78    Stdout.format ("{} out of {} tests failed.", countFailed, countTotal - 1).newline; 
    7579    return true; 
    7680}