Changeset 2294
- Timestamp:
- 02/27/10 22:11:13 (2 years ago)
- Location:
- cobra/trunk/Source
- Files:
-
- 4 modified
-
BackEndClr/SharpGenerator.cobra (modified) (1 diff)
-
Cobra.Lang/CobraCore.cobra (modified) (1 diff)
-
Cobra.Lang/Native.cs (modified) (1 diff)
-
Cobra.Lang/NativeExtern.cobra (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/BackEndClr/SharpGenerator.cobra
r2291 r2294 56 56 print 'using CobraLangInternal = Cobra.Lang[.embedRunTimeSuffix];' 57 57 print '' 58 print 'class RunTests{'58 print 'class _GeneratedTestRunner {' 59 59 print '' 60 60 print ' public static void Main() {' 61 61 print ' CobraLangInternal.CobraImp.ShowTestProgress = true;' 62 62 if .hasExceptionReportOption 63 print ' bool success = false;'64 63 print ' try {' 65 64 print ' CobraLangInternal.Test.ITestRunListener listener = new CobraLangInternal.Test.TextWriterListener(System.Console.Out);' 66 65 print ' new CobraLangInternal.Test.TestRunner(listener).RunAllTests();' 67 66 if .hasExceptionReportOption 68 print ' success = true;'69 67 print ' } catch (System.Exception e) {' 70 68 print ' CobraLangInternal.CobraCore.HandleUnhandledException(e);' 71 69 print ' }' 72 print ' if (success)'73 print ' CobraLangInternal.CobraImp.TestProgressWriter.WriteLine("\\nSuccess! All tests pass.\\n");'74 70 print ' }' 75 71 print '}' 76 .mainMethodTypeName = ' RunTests'72 .mainMethodTypeName = '_GeneratedTestRunner' 77 73 _modules.add(SharpModule(fileName, _verbosity)) 78 74 -
cobra/trunk/Source/Cobra.Lang/CobraCore.cobra
r2293 r2294 138 138 Run all Cobra `test` sections in all assemblies using reflection to locate them. 139 139 """ 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) 142 142 tr = Cobra.Lang.Test.TestRunner(listener) 143 143 tr.runAllTests -
cobra/trunk/Source/Cobra.Lang/Native.cs
r2253 r2294 747 747 set { 748 748 _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();774 749 } 775 750 } -
cobra/trunk/Source/Cobra.Lang/NativeExtern.cobra
r2067 r2294 16 16 get detailedStackTrace as Stack<of CobraFrame> 17 17 pass 18 pro showTestProgress as bool 19 get 20 pass 21 set 22 pass 18 23 def reset(printDestination as System.IO.TextWriter) 19 24 pass



