Test.st 853 B

123456789101112131415161718192021222324252627
  1. Smalltalk current createPackage: 'Test' properties: #{}!
  2. Object subclass: #NodeTestRunner
  3. instanceVariableNames: ''
  4. package: 'Test'!
  5. !NodeTestRunner class methodsFor: 'not yet classified'!
  6. initialize
  7. self runTestSuite
  8. !
  9. runTestSuite
  10. | result |
  11. result := TestResult new.
  12. ((TestCase allSubclasses
  13. select: [ :each | each isAbstract not ])
  14. do: [ :each | each buildSuite do: [ :suite | suite runCaseFor: result ] ]).
  15. console log: result runs asString, ' tests run, ', result failures size asString, ' failures, ', result errors size asString, ' errors.'.
  16. result failures isEmpty ifFalse: [
  17. self throw: result failures first class name, ' >> ', result failures first selector, ' is failing!!' ].
  18. result errors isEmpty ifFalse: [
  19. self throw: result errors first class name, ' >> ', result errors first selector, ' has errors!!' ].
  20. ! !