Ticket #215: lib-tests.patch
File lib-tests.patch, 3.6 KB (added by hopscc, 12 years ago) |
---|
-
Source/CommandLine.cobra
463 463 { 464 464 'name': 'test-runner', 465 465 'type': 'string', 466 'description': 'Specify the method to invoke to run the unit tests. The method must be "shared". Typically the method will make use of classes in Cobra.Core.Test to set up and initiate the test run.',467 'default': 'Cobra.Core.CobraCore.runA llTests',466 'description': 'Specify the method to invoke to run the unit tests. The default runs all tests in the local Assembly, specify "Cobra.Core.CobraCore.runAllTests" to run tests in libraries as well. The method must be "shared". Typically the method will make use of classes in Cobra.Core.Test to set up and initiate the test run.', 467 'default': 'Cobra.Core.CobraCore.runAppTests', 468 468 'args': 'QUALIFIED-METHOD-NAME|nil', 469 469 }, 470 470 { -
Source/BackEndClr/SharpGenerator.cobra
131 131 if target.length 132 132 if target=='lib', target = 'library' 133 133 backEndOptions.add('[optChar]target:[target]') 134 135 if options.boolValue('test') 136 sub='To run the tests in libraries, compile a program that refs the library(ies) and compile it with option "-test-runner:Cobra.Core.CobraCore.runAllTests"' 137 .recordError(SourceException('Cannot specify "-test" with "-target:lib" since csc disallows a main method with library targets. [sub]')) 138 return 134 139 135 140 delaySign = options.boolValue('delay-sign') 136 141 if delaySign, backEndOptions.add('[optChar]delaysign+') -
Source/Cobra.Core/CobraCore.cobra
136 136 137 137 ## Run Tests 138 138 139 def runAppTests 140 _runAllTests(false) 141 139 142 def runAllTests 143 _runAllTests(true) 144 145 def _runAllTests(testDeep as bool) 140 146 """ 141 Run all Cobra `test` sections in all assemblies using reflection to locate them. 147 Run Cobra `test` sections in all assemblies using reflection to locate them. 148 Default is to just run tests in this assembly. 149 If testDeep is true will also run tests in all libraries referenced as well 142 150 """ 143 151 if CobraImp.showTestProgress, listener = Cobra.Core.Test.TextWriterListener(Console.out) 144 152 else, listener = Cobra.Core.Test.TextWriterOnlyOnFailureListener(Console.out) 145 153 tr = Cobra.Core.Test.TestRunner(listener) 154 if testDeep, tr.params.willTestLibraries = true 146 155 tr.runAllTests 147 156 if listener.testFailures, CobraCore.exit(1) 148 157 -
Source/Cobra.Core/Test.cobra
89 89 90 90 pro willRunDry from var = false 91 91 92 pro willTestLibraries from var = false 93 92 94 # TODO: pro excludeTests ... 93 95 94 96 # TODO: pro includeTests ... … … 109 111 110 112 pro listener from var as ITestRunListener? 111 113 112 def runAllTests 113 .runTestsFor(Assembly.getEntryAssembly, false) 114 def runAllTests 115 # default is to not run tests in Libraries 116 .runTestsFor(Assembly.getEntryAssembly, .params.willTestLibraries) 114 117 115 118 def runTestsFor(ass as Assembly, willFollowReferences as bool) 116 119 .runTestsFor(.collectTestsFor(ass, willFollowReferences))