TestCase.st
changeset 599 400bc2cb5690
parent 594 617433e967e9
child 600 71cb19568d8b
equal deleted inserted replaced
598:e76eefb119a9 599:400bc2cb5690
     1 "{ Package: 'stx:goodies/sunit' }"
     1 "{ Package: 'stx:goodies/sunit' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
     2 
     4 
     3 TestAsserter subclass:#TestCase
     5 TestAsserter subclass:#TestCase
     4 	instanceVariableNames:'testSelector'
     6 	instanceVariableNames:'testSelector'
     5 	classVariableNames:''
     7 	classVariableNames:''
     6 	poolDictionaries:''
     8 	poolDictionaries:''
   352 
   354 
   353 !TestCase class methodsFor:'queries'!
   355 !TestCase class methodsFor:'queries'!
   354 
   356 
   355 coveredClassNames
   357 coveredClassNames
   356     "should be redefined to return a collection of classes which are tested by
   358     "should be redefined to return a collection of classes which are tested by
   357      this suite/case. These classes can be instrumented for coverage analysis,
   359      this suite/case. If not redefined, coveredPackageNames should be.
   358      before running the suite"
   360 
   359 
       
   360     ^ #()
       
   361 
       
   362     "Created: / 06-07-2011 / 21:27:03 / cg"
       
   363 !
       
   364 
       
   365 coveredClasses
       
   366     "return a collection of classes which are tested by this suite/case.
       
   367      These classes can be instrumented for coverage analysis,
   361      These classes can be instrumented for coverage analysis,
   368      before running the suite"
   362      before running the suite"
   369 
   363 
       
   364     ^ #()
       
   365 
       
   366     "Created: / 06-07-2011 / 21:27:03 / cg"
       
   367 !
       
   368 
       
   369 coveredClasses
       
   370     "return a collection of classes which are tested by this suite/case,
       
   371      from either the coveredPackageNames or coveredClassNames
       
   372      (which ever returns non-nil.
       
   373 
       
   374      These classes can be instrumented for coverage analysis,
       
   375      before running the suite"
       
   376 
       
   377     self coveredPackageNames notNil ifTrue:[
       
   378         ^ self coveredPackageNames 
       
   379                     collectAll:[:eachPackage | Smalltalk allClassesInPackage:eachPackage].
       
   380     ].
   370     ^ self coveredClassNames collect:[:each | Smalltalk classNamed:each]
   381     ^ self coveredClassNames collect:[:each | Smalltalk classNamed:each]
   371 
   382 !
   372     "Created: / 04-07-2011 / 18:16:08 / cg"
   383 
       
   384 coveredPackageNames
       
   385     "redefine this in a concrete testCase class to return non-nil,
       
   386      to return a collection of packages which are tested by this suite/case.
       
   387      If not redefined, coveredClassNames should be redefined.
       
   388 
       
   389      These classes can be instrumented for coverage analysis,
       
   390      before running the suite"
       
   391 
       
   392     ^ nil
   373 ! !
   393 ! !
   374 
   394 
   375 !TestCase class methodsFor:'quick testing'!
   395 !TestCase class methodsFor:'quick testing'!
   376 
   396 
   377 assert: aBoolean
   397 assert: aBoolean
   935 ! !
   955 ! !
   936 
   956 
   937 !TestCase class methodsFor:'documentation'!
   957 !TestCase class methodsFor:'documentation'!
   938 
   958 
   939 version
   959 version
   940     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.105 2014-11-18 18:22:22 cg Exp $'
   960     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.106 2015-02-01 02:38:55 cg Exp $'
   941 !
   961 !
   942 
   962 
   943 version_CVS
   963 version_CVS
   944     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.105 2014-11-18 18:22:22 cg Exp $'
   964     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.106 2015-02-01 02:38:55 cg Exp $'
   945 !
   965 !
   946 
   966 
   947 version_SVN
   967 version_SVN
   948     ^ '$Id: TestCase.st,v 1.105 2014-11-18 18:22:22 cg Exp $'
   968     ^ '$Id: TestCase.st,v 1.106 2015-02-01 02:38:55 cg Exp $'
   949 ! !
   969 ! !
   950 
   970 
   951 
   971 
   952 TestCase initialize!
   972 TestCase initialize!