Changeset 2295 for cobra/trunk/Source/BackEndClr/SharpGenerator.cobra
- Timestamp:
- 02/28/10 21:24:48 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/BackEndClr/SharpGenerator.cobra
r2294 r2295 62 62 if .hasExceptionReportOption 63 63 print ' try {' 64 print ' CobraLangInternal.Test.ITestRunListener listener = new CobraLangInternal.Test.TextWriterListener(System.Console.Out);' 65 print ' new CobraLangInternal.Test.TestRunner(listener).RunAllTests();' 64 .writeSharpRunAllTests(f) 66 65 if .hasExceptionReportOption 67 66 print ' } catch (System.Exception e) {' … … 72 71 .mainMethodTypeName = '_GeneratedTestRunner' 73 72 _modules.add(SharpModule(fileName, _verbosity)) 73 74 def writeSharpRunAllTests(cw as CurlyWriter) 75 runner = .options['test-runner'] to String # ex: Cobra.Lang.CobraCore.runAllTests, ex: MyProgram.runTests 76 if runner <> 'nil' 77 if runner.endsWith('()'), runner = runner[:-2] 78 if runner.startsWith('Cobra.Lang.'), runner = 'CobraLangInternal.' + runner['Cobra.Lang.'.length:] 79 parts = List<of String>(runner.split(c'.')) 80 if parts.count > 1 81 parts[parts.count-1] = parts.last[0].toUpper.toString + parts.last[1:] 82 stmt = parts.join('.') + '();' 83 cw.writeLine(stmt) 74 84 75 85 var _didWriteSharpInfoClass as bool … … 1840 1850 sw.indent 1841 1851 if .isMain and .compiler.options.boolValue('include-tests') 1842 sw.writeLine('CobraLangInternal.CobraCore.RunAllTests(); // turn off with -include-tests:no (see cobra -h)')1852 (.compiler to Compiler).writeSharpRunAllTests(sw) 1843 1853 1844 1854 def writeSharpImpFooter(sw as CurlyWriter)



