Better command line help for standalone report runner.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 27 May 2014 18:06:15 +0200
changeset 234 b48196ea5f68
parent 233 8ea8b3692704
child 235 3769ae14139a
Better command line help for standalone report runner.
reports/Builder__TestReport.st
--- a/reports/Builder__TestReport.st	Tue May 27 18:06:08 2014 +0200
+++ b/reports/Builder__TestReport.st	Tue May 27 18:06:15 2014 +0200
@@ -3,7 +3,7 @@
 "{ NameSpace: Builder }"
 
 Report subclass:#TestReport
-	instanceVariableNames:'suite coverage'
+	instanceVariableNames:'suite coverage instrument'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Builder-Reports'
@@ -62,12 +62,33 @@
     ^CmdLineOption new
         short: $c;
         long: 'coverage';
-        description: 'Collect code coverage when running tests';
+        description: 'collect code coverage when running tests';
         action:[
             coverage := CoverageReport new.
         ]
 
     "Created: / 25-06-2013 / 15:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-05-2014 / 16:54:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cmdlineOptionInstrument
+
+    ^CmdLineOption new
+        short: $I;
+        long: 'instrument';
+        description: 'extra package to instrument for coverage (implies --coverage)';
+        action:[:package |
+            instrument isNil ifTrue:[ 
+                instrument := Set new.
+            ].
+            instrument add: package.
+            coverage isNil ifTrue:[ 
+                coverage := CoverageReport new.
+            ].
+
+        ]
+
+    "Created: / 27-05-2014 / 16:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReport methodsFor:'initialization'!
@@ -132,9 +153,12 @@
     ].
     coverage notNil ifTrue:[
         coverage setupForPackages: packages.
+        instrument notNil ifTrue:[ 
+            coverage setupForPackages: instrument.
+        ].
     ]
 
-    "Modified: / 25-06-2013 / 16:12:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-05-2014 / 16:35:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setupForSuite: suiteToAdd
@@ -340,8 +364,10 @@
     sel size > 20 ifTrue:[
         sel := '...' , (sel copyFrom: sel size - 16 to: sel size)
     ].
+    Transcript showCR:('%1 >> #%2' bindWith: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport).
     Transcript show:('%-20s >> %-20s : ' printfWith: nm with: sel). 
 
+
     outcome := self createOutcome.
     outcome testCase: aTestCase.