How to run the test262 test suite?

195 views
Skip to first unread message

P

unread,
Sep 4, 2020, 7:47:26 AM9/4/20
to mozilla-rhino
Hi,

Am trying our a few things in the codebase and would like to run the test262 tests, but cannot find how.

Did find some pointers in some merged pull requests like https://github.com/mozilla/rhino/pull/205, but no steps how to actually run the test suite.


From the readme in https://github.com/mozilla/rhino I figured out I can run ./gradlew test and I've run `./gradlew tasks` to see all tasks, but that list doesn't include anything that looks like just the test262 suite nor does that list include `testBenchmark`, which, according to the readme is one of the tasks

TIA
Paul

Gregory Brail

unread,
Sep 4, 2020, 1:41:37 PM9/4/20
to mozill...@googlegroups.com
Sorry about the out of date Mozilla pages. The README should be helpful, and if not, let's fix it!

The test262 tests live in a submodule. The readme says:

git submodule init
git submodule update
./gradlew test

Did that work for you? If you get on the order of 90,000 tests then the test262 tests ran...


--
You received this message because you are subscribed to the Google Groups "mozilla-rhino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-rhin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mozilla-rhino/d2444872-d80b-4d65-bb0f-553d8130cb75n%40googlegroups.com.

P

unread,
Sep 5, 2020, 2:23:56 AM9/5/20
to mozilla-rhino
Hi Greg,

Yeah, running all tests worked, was under the impression one could run just the test262 suite somehow, as running all tests take +/- 30 minutes on my machine

But that's  not an option, you have to run the entire testsuite?

I was planning in modifying the test262.properties to only run a few sets of tests in the area I'm working on, as to reduce the feedback loop from +/- 30 minutes to run all tests to hopefully max a few minutes to run only a specific set of tests from the test262 suite.

If this is currently not possible, does it sound feasible to make this possible? Never done any gradle stuff before, but if it seems feasible I probably will dig into it

Paul

Gregory Brail

unread,
Sep 8, 2020, 1:24:41 PM9/8/20
to mozill...@googlegroups.com
If you can find "Test262SuiteTest" in the source tree, then it's got all the logic to parse the properties file, figure out which tests to run, and run them.

One thing you can do is set the environment variable (not Java system property) TEST_262_OPTLEVEL to -1. 

By default, the Test262 suite runs each test three times at three different optimization levels. By setting that level (to anything, really) you only run each test once, which is fine when you're building stuff. Furthermore, compiling actually takes some time so setting it to -1 (interpreter mode) actually makes the test suite run fastest in my experience because the tests are all very short.

With that set, I've had success just running "Test262SuiteTest" in Intellij and it's not terrible.

I could see how some improvements to that test runner might produce another environment variable that makes it possible to cut down the list of tests even farther.

But yeah, for real new feature development I find it easiest to first create a test case that runs as a standalone script, like the ones in the testsrc/jstests directory, and then follow up by enabling Test262 when closer to check the smaller details of spec compliance.


P

unread,
Sep 9, 2020, 9:24:38 AM9/9/20
to mozilla-rhino
Tnx, I'll go and fiddle :-)

P

unread,
Sep 14, 2020, 3:07:48 PM9/14/20
to mozilla-rhino
Quick update: figured out I can just run the  Test262SuiteTest  suite from the commandline with teh following command:
 `./gradlew test --tests org.mozilla.javascript.tests.Test262SuiteTest`

And if you then modify testsrc/test262.properties to only contain the set of tests you're interested in, running the tests is taking a lot less time: I just run the Proxy and Reflect tests and they're done in +/- 20 seconds

Gregory Brail

unread,
Sep 18, 2020, 4:44:30 PM9/18/20
to mozill...@googlegroups.com
Thank you! If you'd like to submit a PR with additional helpful docs in the README.md I bet a lot of people would appreciate it.


P

unread,
Sep 21, 2020, 2:27:30 PM9/21/20
to mozilla-rhino
yeah, already cooking up something. Also added the ability to set the optimizationLevel and which .properties to use from the command line

Expect a PR this week or next

P

unread,
May 18, 2021, 7:33:59 AM5/18/21
to mozilla-rhino
Reply all
Reply to author
Forward
0 new messages