Question about SimpleTest

0 views
Skip to first unread message

Giulio Cesare Solaroli

unread,
Feb 25, 2009, 4:01:55 AM2/25/09
to MochiKit
Hello,

I have a question about SimpleTest, and I dare to post it here as
MochiKit is the only tool that I know of using it.

We are using SimpleTest for testing our own project, but we have now
grown a little bit too much in order to keep stuff under control.
In order to keep everything in order, I would love to be able to call
test suites recursively; that is, being able to include in the
TestRunner.runTests list an html file that has a call to
TestRunner.runTests in it.

This will allow me to have a top level index.html test file, that
would only list the subprojects index.html test files.

Is there any way you are aware of to handle this scenario?

Thanks for your attention.

Regards,

Giulio Cesare

Per Cederberg

unread,
Feb 25, 2009, 1:54:59 PM2/25/09
to MochiKit
Interesting that you're using SimpleTest! It is on my not-so-secret
agenda for 1.5 to merge that into MochiKit.Test and create a public
API for JS testing.

To answer your question -- I think the tests/index.html file in the
MochiKit distribution does this. It might not be all that elegant
though.

Be sure to let me know if you have any ideas regarding creating an
improved testing API.

Cheers,

/Per

Giulio Cesare Solaroli

unread,
Feb 25, 2009, 7:35:20 PM2/25/09
to Per Cederberg, MochiKit
Hello Per,

On Wed, Feb 25, 2009 at 7:54 PM, Per Cederberg <cede...@gmail.com> wrote:
>
> Interesting that you're using SimpleTest! It is on my not-so-secret
> agenda for 1.5 to merge that into MochiKit.Test and create a public
> API for JS testing.

Interesting; but SimpleTest is quite fine for my current needs


> To answer your question -- I think the tests/index.html file in the
> MochiKit distribution does this. It might not be all that elegant
> though.

Nope. The tests/index.html files invoke the TestRunner.runTests method
on a list of "regular" html test files.

What I need is a way to create a tests/index.html test suite, that
could include a call to (for example) tests/module1/index.html; where
the later file is structured just like the former.


> Be sure to let me know if you have any ideas regarding creating an
> improved testing API.

At the moment our testing needs are fulfilled by SimpleTest api. The
only problem we have, is that sometimes tests fail silently, and if
you don't know the correct number of expected tests, you may miss some
errors. :-(

But this is just an implementation issue.

Regards,

Giulio Cesare

Giulio Cesare Solaroli

unread,
Mar 30, 2009, 8:39:20 AM3/30/09
to Per Cederberg, MochiKit
Hello Per,

I have been able to hack the SimpleTest.TestRunner code in order to be
"recursive", that is I can now have a TestRunner load other
TestRunners and not just SimpleTests as in the current code.

I still have a strange problem with Firefox 3.08 where the number of
successful tests reported is sometimes wrong, but otherwise it works
fine.

Attached you can find my updated version of TestRunner.js and
SimpleTest.js, in case anyone is interested.

Regards,

Giulio Cesare

SimpleTest.js
TestRunner.js

Per Cederberg

unread,
Mar 30, 2009, 2:55:30 PM3/30/09
to Giulio Cesare Solaroli, MochiKit
Thanks for the updated code Guilio! I'll have a look at it later on
and get back to you.

I'm currently a bit absent from MochiKit-related work, but I'll be
back in a month or two I hope. Like most other people lurking around
here it seems that I'm working on one or two projects too many... :-)

Cheers,

/Per

On Mon, Mar 30, 2009 at 2:39 PM, Giulio Cesare Solaroli

Giulio Cesare Solaroli

unread,
Mar 31, 2009, 12:30:25 PM3/31/09
to MochiKit
If anybody is interested, I have also added a total at the bottom of
the TestRunner summary with number of total test passed and failed.
Very rewarding to see when the number of tests grows!! :-)

Giulio Cesare

Reply all
Reply to author
Forward
0 new messages