Laurent,

I have similar needs. I would like to extend SUnit before and after each test 
method. I was wondering about this:

- Introduce a registration mechanism in SUnit (a bit like OB commands)
- TestResult>>runCase: aTestCase can be enhanced by executing what has been 
registered before and after 
- A class TestCommand contains a method #before and #after. TestCommand define 
inst var #currentTestCase #currentTestMethod

Advantages:
- minor addition to SUnit


We could then refactor the SUnit history to use a command.
It would then be easy to have a logger or something.

Does it make sense?

cheers,
Alexandre

On 29 Jul 2010, at 11:08, laurent laffont wrote:

> Hi,
> 
> Autotest use a wrapper to count hits on changed method. Take a look at 
> Autotest>>#findRunAndShowTestsOf
> 
> and replace:
> 
>       counter := AutotestHitCounter on: changedMethod.  <- this wraps the 
> method
>       [aTestResult := runner run: testMethods] 
>        ensure: [counter uninstall].
>    aTestResult hitCount: counter hitCount.
> 
> by
> 
> aTestResult := runner run: testMethods
> 
> 
> to check that the problem is here.
> 
> 
> I haven't tried Cog yet. Is it working out of the box ?
> 
> 
> 
> Laurent 
> 
> 
> On Thu, Jul 29, 2010 at 10:48 AM, Tudor Girba <[email protected]> wrote:
> Ah, indeed! I forgot ... sorry for the noise :)
> 
> Cheers,
> Doru
> 
> 
> 
> On 29 Jul 2010, at 10:45, Henrik Johansen wrote:
> 
> On Jul 29, 2010, at 10:40 55AM, Tudor Girba wrote:
> 
> Hi,
> 
> It looks like Autotest is crashing on a Cog VM/image. Any ideas as to why 
> that happen?
> 
> Cheers,
> Doru
> 
> 
> If he went for using MethodWrappers as described below, it will crash on Cog, 
> as it does not support objects as methods yet.
> 
> Cheers,
> Henry
> 
> 
> 
> On 27 Jul 2010, at 10:11, Alexandre Bergel wrote:
> 
> Indeed I also want to log for each test:
> - min / max / mean execution time
> - time to first failure
> - % of errors/failures/success
> - run count
> 
> That would be cool
> 
> so with these datas we know long tests. I think about wrapping run test 
> methods with an object which then can collect these datas. Would you go this 
> way ?
> (Another way is to modify TestResult / TestCase, but it's more intrusive).
> 
> Over the last few month I intensively used method wrapper (a.k.a object as 
> compiled method). Time to time, the image just freezes or crashes. Maybe due 
> to the garbage collector. Modifying SUnit should not be that complex. It 
> would be nice to turn SUnit into something more extensible. One shoot two 
> targets.
> 
> 
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> 
> --
> www.tudorgirba.com
> 
> "One cannot do more than one can do."
> 
> 
> 
> 
> 
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> 
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to