This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 258
Integrate Test262 #654
Merged
Merged
Integrate Test262 #654
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c9cefb1
Integrate Test262
jugglinmike 110ace2
fixup! Integrate Test262
jugglinmike 496029a
fixup! Integrate Test262
jugglinmike 8b0018d
fixup! Integrate Test262
jugglinmike 2957990
fixup! Integrate Test262
jugglinmike 03bfc28
fixup! Integrate Test262
jugglinmike 48486ab
fixup! Integrate Test262
jugglinmike 10aadef
fixup! Integrate Test262
jugglinmike 81b210b
fixup! Integrate Test262
jugglinmike 78b3465
use graceful-fs and latest yarn on travis
existentialism 908fa7b
Merge branch 'master' into test262
existentialism File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workspaces-experimental true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
const chalk = require("chalk"); | ||
const utils = require("./run_test262_utils"); | ||
|
||
const testDir = path.join(__dirname, "..", "build", "test262", "test"); | ||
const whitelistFile = path.join(__dirname, "test262_whitelist.txt"); | ||
const plugins = ["asyncGenerators", "objectRestSpread"]; | ||
const shouldUpdate = process.argv.indexOf("--update-whitelist") > -1; | ||
|
||
Promise.all([utils.getTests(testDir), utils.getWhitelist(whitelistFile)]) | ||
.then(function([tests, whitelist]) { | ||
const total = tests.length; | ||
const reportInc = Math.floor(total / 20); | ||
|
||
console.log(`Now running ${total} tests...`); | ||
|
||
const results = tests.map(function(test, idx) { | ||
if (idx % reportInc === 0) { | ||
console.log(`> ${Math.round(100 * idx / total)}% complete`); | ||
} | ||
|
||
return utils.runTest(test, plugins); | ||
}); | ||
|
||
return utils.interpret(results, whitelist); | ||
}) | ||
.then(function(summary) { | ||
const goodnews = [ | ||
summary.allowed.success.length + " valid programs parsed without error", | ||
summary.allowed.failure.length + | ||
" invalid programs produced a parsing error", | ||
summary.allowed.falsePositive.length + | ||
" invalid programs did not produce a parsing error" + | ||
" (and allowed by the whitelist file)", | ||
summary.allowed.falseNegative.length + | ||
" valid programs produced a parsing error" + | ||
" (and allowed by the whitelist file)", | ||
]; | ||
const badnews = []; | ||
const badnewsDetails = []; | ||
|
||
void [ | ||
{ | ||
tests: summary.disallowed.success, | ||
label: | ||
"valid programs parsed without error" + | ||
" (in violation of the whitelist file)", | ||
}, | ||
{ | ||
tests: summary.disallowed.failure, | ||
label: | ||
"invalid programs produced a parsing error" + | ||
" (in violation of the whitelist file)", | ||
}, | ||
{ | ||
tests: summary.disallowed.falsePositive, | ||
label: | ||
"invalid programs did not produce a parsing error" + | ||
" (without a corresponding entry in the whitelist file)", | ||
}, | ||
{ | ||
tests: summary.disallowed.falseNegative, | ||
label: | ||
"valid programs produced a parsing error" + | ||
" (without a corresponding entry in the whitelist file)", | ||
}, | ||
{ | ||
tests: summary.unrecognized, | ||
label: "non-existent programs specified in the whitelist file", | ||
}, | ||
].forEach(function({ tests, label }) { | ||
if (!tests.length) { | ||
return; | ||
} | ||
|
||
const desc = tests.length + " " + label; | ||
|
||
badnews.push(desc); | ||
badnewsDetails.push(desc + ":"); | ||
badnewsDetails.push( | ||
...tests.map(function(test) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also breaks in Node 4 😄 |
||
return test.id; | ||
}) | ||
); | ||
}); | ||
|
||
console.log("Testing complete."); | ||
console.log("Summary:"); | ||
console.log(chalk.green(goodnews.join("\n").replace(/^/gm, " ✔ "))); | ||
|
||
if (!summary.passed) { | ||
console.log(""); | ||
console.log(chalk.red(badnews.join("\n").replace(/^/gm, " ✘ "))); | ||
console.log(""); | ||
console.log("Details:"); | ||
console.log(badnewsDetails.join("\n").replace(/^/gm, " ")); | ||
} | ||
|
||
if (shouldUpdate) { | ||
return utils.updateWhitelist(whitelistFile, summary).then(function() { | ||
console.log(""); | ||
console.log("Whitelist file updated."); | ||
}); | ||
} else { | ||
process.exitCode = summary.passed ? 0 : 1; | ||
} | ||
}) | ||
.catch(function(err) { | ||
console.error(err); | ||
process.exitCode = 1; | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we do a depth=x here as well?