Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug 469718 - JavaScript Browser jsreftests

11 views
Skip to first unread message

Bob Clary

unread,
Sep 27, 2009, 12:49:07 PM9/27/09
to
https://bugzilla.mozilla.org/show_bug.cgi?id=469718 landed on
tracemonkey yesterday which enables the ability to run the JavaScript
tests in the browser using the reftest framework.

To run the tests, do

make -C $(OBJDIR) jstestbrowser

https://bugzilla.mozilla.org/show_bug.cgi?id=509629 tracks dmandelin's
new shell test framework which will use the same manifests.

One change you will see right away is the JavaScript tests have moved
from js/tests to js/src/tests. All new tests should be placed in
js/src/tests.

The other change is the existence of the reftest-style manifests which
detail which tests are to be run, which tests are expected to fail and
which tests should be skipped. You must keep the manifests up to date
when adding new suites, sub-suites or tests.

The advantage to you is the manifests will keep track of known failures
and allow the framework to emit an UNEXPECTED error for regressions. You
no longer will have to do baseline runs or maintain separate lists of
known failures.

The tests complete in less than 10 minutes for opt builds and less than
20 minutes for debug builds on my Mac Book. If there are tests which you
think take too long and wish to disable, simply add the skip keyword to
the appropriate manifest to disable running the test.

Finally, all tests must call one of the reportCompare() family of
functions to record passing or failure of the test. If you do not call
reportCompare() or its cousins, the test will fail with an unexpected error.

This is currently only on tracemonkey, but will land on mozilla-central
during the next merge. I also hope to get this onto 1.9.2 shortly
thereafter. The plan is to get these running on the unittest machines as
soon as possible.

For more background and details on how to run the tests please see
http://bclary.com/blog/2009/09/10/browser-javascript-reftests/

bc

Boris Zbarsky

unread,
Dec 3, 2009, 11:22:59 PM12/3/09
to
On 9/27/09 12:49 PM, Bob Clary wrote:
> https://bugzilla.mozilla.org/show_bug.cgi?id=469718 landed on
> tracemonkey yesterday which enables the ability to run the JavaScript
> tests in the browser using the reftest framework.
>
> To run the tests, do
>
> make -C $(OBJDIR) jstestbrowser

Once I do that and it fails, how do I run a single test (the failing
one) so I can debug it?

-Boris

Bob Clary

unread,
Dec 4, 2009, 2:40:34 AM12/4/09
to
bz and I met up on #jsapi, but for everyone else:

from the js/src/tests dir, load

'./jsreftest.html?test=<relativepathtojstest>'

You should have js/src/tests/user.js in your profile. you can either
copy it to an existing profile and load via -P as in

../../../firefox-debug/dist/FirefoxDebug.app/Contents/MacOS/firefox -P
test './jsreftest.html?test=ecma/extensions/10.1.4-9.js'

or just copy it to an empty dir to use as your profile dir:

cp user.js ~/tmp/profile/

../../../firefox-debug/dist/FirefoxDebug.app/Contents/MacOS/firefox
-profile ~/tmp/profile './jsreftest.html?test=ecma/extensions/10.1.4-9.js'

user.js now has content and chrome jit turned on so the ;jit addition is
meaningless in most cases, but the gzceal= addition may be of use. For
example to turn on gczeal 2

../../../firefox-debug/dist/FirefoxDebug.app/Contents/MacOS/firefox
-profile ~/tmp/profile
'./jsreftest.html?test=ecma/extensions/10.1.4-9.js;gczeal=2'

of course, you can run the test from any dir using the full path but
this is pita.

/work/mozilla/builds/1.9.3/mozilla/firefox-debug/dist/FirefoxDebug.app/Contents/MacOS/firefox
-P test
'file:///work/mozilla/builds/1.9.3/mozilla/js/src/tests/jsreftest.html?test=ecma/extensions/10.1.4-9.js'

I'll try to get some wiki-goodness going soon, but have some other more
pressing issues.

please ask and i will tell.

bc

0 new messages