You are here: Foswiki>Tasks Web>Item400 (20 Sep 2009, KennethLavrsen)Edit Attach

Item400: unit test runner should be more magical smile

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.0.7
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: Foswiki:Main.SvenDowideit
Waiting For:
Last Change By: KennethLavrsen
for eg, I should be able to run ../bin/TestRunner.pl -clean SlideShowPlugin, which makes it look for the nearest Suite file

or ../bin/TestRunner.pl -clean should look for the nearest Suite file (ie the FoswikiSuite.pm)

also, I'd like to be able to request it to run just one specific test - ../bin/TestRunner.pl -clean SlideShowPluginTests::test_Simple


Confirmed and regraded to enhancement. This is one of these "if you don't do it, nobody else is going to unless they need the same thing" jobs.

-- CrawfordCurrie - 08 Mar 2009

Done on trunk. Shall I merge it to the release branch?

-- OlivierRaginel - 24 Mar 2009

release branch - sounds good smile

oh, the cruelty - I can think of another - ../bin/TestRunner.pl -clean SomeTests::verify_NotSoSimple

-- SvenDowideit - 27 Mar 2009

This works for me. The filter is done on the test array that's built, so if you can see it in the output, you can run it.

And I've merged it onto the release branch.

Sven, thanks to close if it fits your needs smile

-- OlivierRaginel - 29 Mar 2009

As Lavr pointed out, it broke the Suite tests, so: ../bin/TestRunner.pl -clean CommentPlugin/CommentPluginSuite.pm

I've fixed that, but now I'm puzzled. What should: ../bin/TestRunner.pl -clean CommentPlugin do? For now, it finds both CommentPlugin/CommentPluginSuite.pm and CommentPlugin/CommentPluginTests.pm, and run them both. As the Suite one just includes the Tests one, it's a bit silly.

So what I could do is favor the Suite one if one is found.

Input appreciated...

What I did is:

So in brief, I think I kept compatibility, with enhancing functionnality.

Let me know if you still can think of something that's not done, or if you can find some ways that aren't working.

-- OlivierRaginel - 30 Mar 2009

I don't understand the examples. How does TestRunner.pl TranslatorTests know where to find TranslatorTests.pm?

I don't want to throw you into confusion, but I could get my head round a package specification relative to test/unit; Make / synonymous with :: and strip trailing .pm and you are cooking with gas. I don't perceive any requirement to simplify it further than that.

-- CrawfordCurrie - 04 Apr 2009

Sorry, hadn't seen your comment before. It knows where to find it by looking for anything that matches TranslatorTests.* in the test/unit folder, recursively.

Therefore, there is no need to specify the plugin name.
  • TestRunner.pl WysiwygPlugin/TranslatorTests -- works, and has always worked
The rest was made so that one can copy/paste the output of a test suite that fails to re-run that specific test.

I think I implemented what you were asking for without reading that. Like one say, great minds think alike.

Please, let me know if you see any way to enhance that further, otherwise I'll close it.

-- OlivierRaginel - 22 Apr 2009

I like what you've done - thanks!

-- SvenDowideit - 10 May 2009

i recon its magical.

-- SvenDowideit - 08 Aug 2009

ItemTemplate edit

Summary unit test runner should be more magical smile
ReportedBy Foswiki:Main.SvenDowideit
Codebase
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:df33a26e05cf distro:1838e2ec686b distro:d77716ce1e89 distro:8c2afca889cb
TargetRelease patch
ReleasedIn 1.0.7
Topic revision: r20 - 20 Sep 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy