On Sat, Mar 19, 2011 at 6:52 PM, Stefan Marr
<pharo@stefan-marr.de> wrote:
Hi:
I have a design problem with my test cases.
In my benchmark suite I have a runner class that controls how benchmarks are executed.
Now I want to subclass it to provide a runner that automatically finds a reasonable number of iterations for microbenchmarks. Thus, it will first measure the time of a first run and then double the number of iterations until it has some like at least 300ms runtime.
Ok, thats the domain design, now the question how do I test that hierarchy with SUnit?
It seems like my test hierarchy that parallels the domain hierarchy is not actually working like I would expected it.
Thus, my basic test class implements some 9 tests, and my auto-sizing test-class adds two more test.
However, when I run the tests, only 11 tests are executed and not 2*9 + 2 = 20 tests.
Is there something I am missing? Is there a way that I can force SUnit to also execute the tests of the superclass?
Yes the tests defined in the superclass are not executed.��
Another way is to define a Trait with your 9 tests, remove the superclass and have the other test classes use that Trait - tests for collections use this patterns, ProfStef tutorial tests too.
��
Or, something that would actually be nice, is there a way that I can automatically parameterize my tests with data?
Could you explain a little more ?
Laurent
��
Then I would not need to us subclassing in my test hierarchy, but could just tell the basic tests to run with all the different runner classes, and for the autosizing runners, I can just run additional tests.
Thanks
Stefan
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: �� +32 2 629 3525
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: �� +32 2 629 3525