Wiki

Changeset 2294

Show
Ignore:
Timestamp:
02/27/10 22:11:13 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Code cleanup.

Location:
cobra/trunk/Source
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/BackEndClr/SharpGenerator.cobra

    r2291 r2294  
    5656                print 'using CobraLangInternal = Cobra.Lang[.embedRunTimeSuffix];' 
    5757                print '' 
    58                 print 'class RunTests {' 
     58                print 'class _GeneratedTestRunner {' 
    5959                print '' 
    6060                print ' public static void Main() {' 
    6161                print '     CobraLangInternal.CobraImp.ShowTestProgress = true;' 
    6262                if .hasExceptionReportOption 
    63                     print '     bool success = false;' 
    6463                    print '     try {' 
    6564                print '     CobraLangInternal.Test.ITestRunListener listener = new CobraLangInternal.Test.TextWriterListener(System.Console.Out);' 
    6665                print '     new CobraLangInternal.Test.TestRunner(listener).RunAllTests();' 
    6766                if .hasExceptionReportOption 
    68                     print '     success = true;' 
    6967                    print '     } catch (System.Exception e) {' 
    7068                    print '         CobraLangInternal.CobraCore.HandleUnhandledException(e);' 
    7169                    print '     }' 
    72                     print '     if (success)' 
    73                 print '     CobraLangInternal.CobraImp.TestProgressWriter.WriteLine("\\nSuccess!  All tests pass.\\n");' 
    7470                print ' }' 
    7571                print '}' 
    76         .mainMethodTypeName = 'RunTests' 
     72        .mainMethodTypeName = '_GeneratedTestRunner' 
    7773        _modules.add(SharpModule(fileName, _verbosity)) 
    7874 
  • cobra/trunk/Source/Cobra.Lang/CobraCore.cobra

    r2293 r2294  
    138138                Run all Cobra `test` sections in all assemblies using reflection to locate them. 
    139139                """ 
    140                 # listener = Cobra.Lang.Test.TextWriterListener(Console.out) 
    141                 listener = Cobra.Lang.Test.TextWriterOnlyOnFailureListener(Console.out) 
     140                if CobraImp.showTestProgress, listener = Cobra.Lang.Test.TextWriterListener(Console.out) 
     141                else, listener = Cobra.Lang.Test.TextWriterOnlyOnFailureListener(Console.out) 
    142142                tr = Cobra.Lang.Test.TestRunner(listener) 
    143143                tr.runAllTests 
  • cobra/trunk/Source/Cobra.Lang/Native.cs

    r2253 r2294  
    747747        set { 
    748748            _showTestProgress = value; 
    749         } 
    750     } 
    751  
    752     static private TextWriter _testProgressWriter = null; 
    753  
    754     static public TextWriter TestProgressWriter { 
    755         get { 
    756             return _testProgressWriter==null ? Console.Out : _testProgressWriter; 
    757         } 
    758         set { 
    759             _testProgressWriter = value; 
    760         } 
    761     } 
    762  
    763     static public void TestBegan(string className) { 
    764         if (ShowTestProgress) { 
    765             TestProgressWriter.WriteLine("Testing {0}...", className); 
    766             TestProgressWriter.Flush(); 
    767         } 
    768     } 
    769  
    770     static public void TestEnded(string className) { 
    771         if (ShowTestProgress) { 
    772             TestProgressWriter.WriteLine("Completed testing of {0}.{1}", className, Environment.NewLine); 
    773             TestProgressWriter.Flush(); 
    774749        } 
    775750    } 
  • cobra/trunk/Source/Cobra.Lang/NativeExtern.cobra

    r2067 r2294  
    1616                get detailedStackTrace as Stack<of CobraFrame> 
    1717                    pass 
     18                pro showTestProgress as bool 
     19                    get 
     20                        pass 
     21                    set 
     22                        pass 
    1823                def reset(printDestination as System.IO.TextWriter) 
    1924                    pass