Commit Graph

10 Commits

Author SHA1 Message Date
Lauren Tan 5e0dba9012 [test262] Always return a pseudo Error object
For unknown reasons I didn't have the energy to dig into, some Babel Error 
objects can't be written to so despite formatting the error message, the 
original one would still be used. To get around this I'm just constructing a 
fake object with a `name` and `message` so the correctly formatted messages are 
used.
2022-12-22 17:40:18 -05:00
Lauren Tan 75fc20981a Fix test262 for realsies
The github action was exceeding maximum allowed memory size because we were no 
longer grouping messages correctly prior to formatting them in the script. I 
think these were introduced when we integrated the Babel plugin into the 
preprocessor. This PR strips out filenames from the message so they can be 
grouped together again. Also added some light comments 

Test plan: manually ran `scripts/test262.sh` and verified that the JSON was 
grouped together correctly
2022-12-22 13:12:08 -05:00
Lauren Tan 003a1772ab Fix broken import path in test262-preprocessor
Previously we weren't ever clearing the `dist` directory so there were likely 
some vestigial files left over from previous builds that might have confused the 
import path. This commit fixes the import path and also deletes the `dist` 
directory on every build to ensure a clean slate.
2022-12-21 16:04:29 -05:00
Joe Savona 079cfe68bf Fix test262 preprocessor
The test262 preprocessor was correctly running forget against all the functions 
in each test file, but it was incorrectly transforming the file contents 
overall. Previously we swapped the contents of the file for the transformed 
output of the last function, now we use the babel plugin to rewrite functions in 
place and keep the rest of the file intact. 

Of course, the tests that failed before still fail. But when we fix them the 
tests will work now.
2022-12-20 16:27:11 -08:00
Lauren Tan ae8f9066dd Fix invalid import path in test262-preprocessor 2022-12-20 11:42:51 -05:00
Lauren Tan 2721d2a0d9 Remove compiler flags
Remove our existing compiler flags since they were only being used for 
enabling/disabling passes to aid debugging and to simplify in preparation for 
the upcoming work on diagnostics and bailouts. Additionally with the new 
playground tabs disabling passes has become less necessary. In the future when 
we have actual compiler flags (eg tweaking optimization levels) we can add this 
back. 

I opted to keep the existing `CompilerResult` return value instead of just 
returning the optimized AST as we're still using `scopes` in our test fixtures.
2022-12-20 11:42:51 -05:00
Lauren Tan 7cf8e9ac42 [ez] Fixup missing passes in test262-preprocessor 2022-12-20 11:13:05 -05:00
Sathya Gunasekaran 0c1f88db6c [test262] Use compiler pipeline in test262 runner (#800) 2022-11-21 18:55:57 +00:00
Lauren Tan 188c1501be Condense test262 output in ci
There's no option to output the results of the test262 harness in silent mode so 
every pass and failure outputs multiple lines to stdout. Since there are many 
thousands of tests this results in unusable log files that are over 200k lines 
long. This PR redirects stdout to a tmp file and then we reformat the result 
into a small JSON object, grouped by the failure message with count. 

Example: 

```json [   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: Support complex object assignment",       "count": 66    
 }   },   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: lowerExpression(FunctionExpression)",       "count": 4   
  }   },   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: lowerExpression(UnaryExpression)",       "count": 6     
}   },   {     "pass": false,     "data": {       "message": "Expected no error, 
got Error: todo: lower initializer in ForStatement",       "count": 28     }   
},   {     "pass": false,     "data": {       "message": "Expected no error, got 
Invariant Violation: Expected value for identifier `15` to be initialized.",     
  "count": 14     }   },   {     "pass": false,     "data": {       "message": 
"Expected no error, got Invariant Violation: `var` declarations are not 
supported, use let or const",       "count": 76     }   },   {     "pass": true, 
    "data": {       "message": null,       "count": 1     }   } ] ```
2022-11-16 18:24:07 -05:00
Lauren Tan 9027117c4f Scaffolding for test262
- Adds a shallow git submodule for test262 as the tests aren't available   as an 
npm module - To run all tests: `yarn test262:all`. Note that this chunks up the  
 tests by test262 folder as there are over 50k+ tests and the test harness only 
accepts arrays of filepaths which exceeds arg limits - To run a specific test: 
`yarn test262 test262/test/folder/file.js`.   You can also pass globs which 
expand into an array of filepaths: `yarn test262 test262/test/folder/**/*.js` - 
More instructions for the test-harness can be found here: 
https://github.com/bterlson/test262-harness
2022-11-15 13:24:14 -05:00