Closed Bug 379779 Opened 17 years ago Closed 17 years ago

JavaScript Tests - Factor common code into top level shell.js|browser.js

Categories

(Core :: JavaScript Engine, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bc, Assigned: bc)

References

Details

Attachments

(2 files)

Each test suite (ecma_3, js1_5, ...) contains a high level shell.js and browser.js file to provide the framework for the JavaScript Test library. A significant amount of the code, especially for later suites ecma_3..., is duplicated between these various sub suites. This is a pita when updates to the common code are required.

I would like to modify the test library to use top level shell.js and browser.js and only put suite specific code in the suite versions. This would mean that in order to run a specific test using the shell, you would write

mozilla/js/tests$

js -f shell.js -f ecma_3/shell.js -f ecma_3/Boolean/shell.js -f ecma_3/Boolean/boolean-001.js

This will also require modifications to jsDriver.pl and the browser-based js-test-driver* files. 

The advantage would be that when it is necessary to update common code across the suites, it won't have to be duplicated in each of the suites as is the case now.

Comments?
Flags: in-testsuite-
I love it.  I'd be happy to modify the Rhino test driver and it would be quite easy to do so.  This potentially has a benefit for test authors, too, since they would be able to look in one place for the main test suite API.
Attached patch patch v1Splinter Review
This patch moves common code from the test sub-suites into the highest level shell.js and browser.js while leaving the differing code in the sub-suite's versions of shell.js and browser.js. 

This patch does not attempt to do anything more than move the common code. If there is similar, albeit different code, it is not modified nor moved by this patch.

I have tested this on linux using the browser and shell and modulo recent regressions in the engine, I believe these changes do not introduce changes in the test results.

I will be filing a different bug for making additional changes related to removing differences between sub-suites and making the shell report individual testcase failures in a similar fashion to that used in the browser.
Attachment #264345 - Flags: superreview?(brendan)
Attachment #264345 - Flags: review?(igor)
Comment on attachment 264345 [details] [diff] [review]
patch v1

This is really nice.
Attachment #264345 - Flags: review?(igor) → review+
Blocks: 380257
Comment on attachment 264345 [details] [diff] [review]
patch v1

sr=me, no need to fuss with sr on this kind of change, I say!

/be
Attachment #264345 - Flags: superreview?(brendan) → superreview+
Attached file commit log
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 381819
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: