TestCase.st
changeset 700 2309c94fe81c
parent 690 cb50d1d3ffeb
child 703 7cf6ad732dc9
equal deleted inserted replaced
699:8c5c77024ad3 700:2309c94fe81c
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "{ Package: 'stx:goodies/sunit' }"
     3 "{ Package: 'stx:goodies/sunit' }"
     2 
     4 
     3 "{ NameSpace: Smalltalk }"
     5 "{ NameSpace: Smalltalk }"
     4 
     6 
     5 TestAsserter subclass:#TestCase
     7 TestAsserter subclass:#TestCase
   453     "
   455     "
   454 ! !
   456 ! !
   455 
   457 
   456 !TestCase class methodsFor:'running'!
   458 !TestCase class methodsFor:'running'!
   457 
   459 
       
   460 debug
       
   461     "run myself as a suite with debugging; return the result"
       
   462 
       
   463     ^ self suite debug
       
   464 
       
   465     "
       
   466      SOAP::XeXMLTests run
       
   467      RegressionTests::OperatingSystemTest run
       
   468     "
       
   469 !
       
   470 
   458 run
   471 run
   459     "run myself as a suite; return the result"
   472     "run myself as a suite; return the result"
   460 
   473 
   461     ^ self suite run
   474     ^ self suite run
   462 
   475 
   498 		and: [self superclass isAbstract
   511 		and: [self superclass isAbstract
   499 			or: [self testSelectors isEmpty]]
   512 			or: [self testSelectors isEmpty]]
   500 ! !
   513 ! !
   501 
   514 
   502 !TestCase methodsFor:'accessing'!
   515 !TestCase methodsFor:'accessing'!
       
   516 
       
   517 countTests
       
   518 
       
   519     ^1
       
   520 
       
   521     "Created: / 04-08-2011 / 13:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   522 !
   503 
   523 
   504 resources
   524 resources
   505 	"We give TestCase this instance-side method so that methods polymorphic with TestSuite can be code-identical.  Having this instance-side method also helps when writing tests of resource behaviour. Except for such tests, it is rare to override this method and should not be done without thought.  If there were a good reason why a single test case needed to share tests requiring different resources, it might be legitimate."
   525 	"We give TestCase this instance-side method so that methods polymorphic with TestSuite can be code-identical.  Having this instance-side method also helps when writing tests of resource behaviour. Except for such tests, it is rare to override this method and should not be done without thought.  If there were a good reason why a single test case needed to share tests requiring different resources, it might be legitimate."
   506 
   526 
   507 	^self class resources
   527 	^self class resources
   531          ^true
   551          ^true
   532     ].
   552     ].
   533     ^false
   553     ^false
   534 
   554 
   535     "Created: / 28-11-2012 / 18:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   555     "Created: / 28-11-2012 / 18:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   536 !
       
   537 
       
   538 testCount
       
   539 
       
   540     ^1
       
   541 
       
   542     "Created: / 04-08-2011 / 13:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   543 ! !
   556 ! !
   544 
   557 
   545 !TestCase methodsFor:'accessing & queries'!
   558 !TestCase methodsFor:'accessing & queries'!
   546 
   559 
   547 unfinished
   560 unfinished