Re: XULRunner unit-tests like xpcshell

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: XULRunner unit-tests like xpcshell

beaufour@gmail.com
(moving to mozilla.dev.quality from .platform, since this really
belongs)

[hidden email] wrote:

> John Gaunt wrote:
> > However I like the idea of having XULRunner Unit-tests even more. I was
> > talking with Steve_k today and discussing options with command line
> > handlers and possbily heading off app startup in order to run unit tests
> > in a full xulrunner environment without UI coming up.
> >
> > I have a test commandline handler written and I can stop the UI from
> > showing by setting "cmdLine.preventDefault = true;". Beyond that I guess
> > just running an eval() of a script might work.  Is there a better way,
> > maybe a component to use? I think at that point I'll have everything I
> > need/want to be able to test things.
>
> I just gave it a quick try, including the head.js and tail.js files
> from the xpcshell tests. Smells like a hack, but seems to work for my
> purpose. As you, I would really like to do a "make check" and do
> window-less unit-testing of XULRunner apps.

So, I've been playing a bit more with this. I've hacked the
xpcshell-simple harness so it fits my needs.
* test files go into the FINAL_TARGET of the application
* created a command line handler that when called with "-test", reads
all the files specified with -f and concats them into one big file it
then evals()
This makes my tests run "inside" the XULRunner application, and "make
check" works as expected.

One problem is that when the application needs to register new
components, and thus restarts, the test fails. But besides from that it
seems to fit the bill.

Is there a bug created for this?

... Allan

_______________________________________________
dev-quality mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-quality
Reply | Threaded
Open this post in threaded view
|

Re: XULRunner unit-tests like xpcshell

Rob Campbell-5
[hidden email] wrote:
> (moving to mozilla.dev.quality from .platform, since this really
> belongs)
 > [snip]
 >
>  Is there a bug created for this?

There is now.

https://bugzilla.mozilla.org/show_bug.cgi?id=359830

--
   Rob Campbell - [hidden email]
_______________________________________________
dev-quality mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-quality