2

I've created a small (test) addition to the Dolphin Smalltalk framework that I want to submit on GitHub later. (1 method: Integer>>isPrime) But first, I want add my testing method of this method to the standard regression test set, with ~ 2400 tests now. (IntegerTest>>testIsPrime) I've found the classes TestCase, DolphinTest, IntegerTest and the SUnit browser. But I didn't find out how to add my test to the standard test set.

Can someone point me the right direction?

quamrana
  • 37,849
  • 12
  • 53
  • 71

1 Answers1

5

I assume you are working from a Git checkout and have the test classes in your image. From there the easiest thing is to modify an existing class (such as IntegerTest) in the code browser, save the package back to the file system, and then Git should show the files as modified.

The neat thing about SUnit is that by default it will include all methods that start with 'test' in the test suite. So just add the test, run the suite, and see the number of tests increase by one!

James Foster
  • 2,070
  • 10
  • 15
  • Also, some background read on SUnit could be of some help. This one is not Dolphin specific, but SUnit does not differ much from Smalltak to Smalltalk http://sdmeta.gforge.inria.fr/Programmez/OnTheWeb/Eng-Art8-SUnit-V1.pdf – Davorin Ruševljan Jul 04 '17 at 13:35
  • So I've already created a test called IntegerTest>>testIsPrime, but I found out that the class IntegerTest is not used at all in the regression tests now. So how to add this class, and at least my one test method, to the standard Dolphin regression tests? (before I commit anything) – FunctionPoint Jul 05 '17 at 20:18
  • Why do you say that the class `IntegerTest` is not used at all in the regression tests now? In a current GitHub checkout, I evaluated the following in a workspace: `SourceManager default fileIn: 'RegressionTestsLoad.st'.` I then added a method to IntegerTest: `testIsPrime self assert: false` And clicked 'Run All' on the `TestRunner`. As expected, my test failure was included in the report. And I just want to commend you for adding a test with other changes. – James Foster Jul 06 '17 at 02:20
  • Hi James, thank you, it's working now! I was looking for my test as Integer>>testIsPrime (as coded), but it is actually executed as SmallInteger>>testIsPrime and additionally as LargeInteger>>testIsPrime. So alphabetically elsewhere in the 2400+ line report. I'll try to merge this change now... – FunctionPoint Jul 06 '17 at 18:55