#DOCUMENTATION
authorClaus Gittinger <cg@exept.de>
Thu, 14 Jan 2016 16:00:31 +0100
changeset 16019 28955f19dbb5
parent 16018 ee40f4eb0904
child 16020 05bc4f6c85cf
#DOCUMENTATION class: Tools::TestRunnerMini changed: #runAllWithCoverage
Tools__TestRunnerMini.st
--- a/Tools__TestRunnerMini.st	Thu Jan 14 15:57:00 2016 +0100
+++ b/Tools__TestRunnerMini.st	Thu Jan 14 16:00:31 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
  Copyright (c) 2009-2010 eXept Software AG
@@ -689,10 +687,29 @@
      tests. Requires that the testcase returns a non-empty collection
      from the coveredClasses query"
 
-    |testedClasses suite|
+    |testedClasses suite packages package instrumentPackage answer|
 
+    suite := self suiteForRunAll.
+
+    instrumentPackage := false.
     testedClasses := self allCoveredClasses.
     testedClasses isEmpty ifTrue:[
+"/        "/ may be in a package?
+"/        packages := suite tests collect:[:eachTest | eachTest class package] as:Set.
+"/        packages remove:'stx:libbasic' ifAbsent:[].
+"/        packages size == 1 ifTrue:[
+"/            package := packages first.
+"/            answer := Dialog 
+"/                confirmWithCancel:(resources 
+"/                                    stringWithCRs:'The test cases do not define any covered class.\(missing #coveredClassNames or #coveredPackageNames method)\\Instrument package("%1") or run without coverage ?'
+"/                                    with:package)
+"/                labels:(resources array:#('No' 'Unstrument Packages' 'Yes')).
+"/            
+"/self halt.
+"/        ] ifFalse:[
+"/            (Dialog confirm:(resources stringWithCRs:'The test cases do not define any covered class.\(missing #coveredClassNames or #coveredPackageNames method)\\Run without coverage ?'))
+"/            ifFalse:[^ self].
+"/        ].
         (Dialog confirm:(resources stringWithCRs:'The test cases do not define any covered class.\(missing #coveredClassNames or #coveredPackageNames method)\\Run without coverage ?'))
         ifFalse:[^ self].
     ] ifFalse:[
@@ -711,8 +728,6 @@
         ].
     ].
 
-    suite := self suiteForRunAll.
-
     self 
         run:suite 
         debug:false 
@@ -1307,14 +1322,14 @@
 !TestRunnerMini class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunnerMini.st,v 1.16 2015-02-28 20:31:47 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TestRunnerMini.st,v 1.16 2015-02-28 20:31:47 cg Exp $'
+    ^ '$Header$'
 !
 
 version_SVN
-    ^ '$Id: Tools__TestRunnerMini.st,v 1.16 2015-02-28 20:31:47 cg Exp $'
+    ^ '$Id$'
 ! !