Skip to content

Commit ff1681e

Browse files
committed
more test262 adjustments
1 parent 5ee1dbf commit ff1681e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

scripts/test262.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ function findFiles() {
206206
}
207207

208208
const files = []
209-
visit(testDir)
209+
for (const entry of fs.readdirSync(testDir)) {
210+
if (entry === 'staging' || entry === 'intl402' || entry === 'built-ins') continue // We're not interested in these
211+
visit(path.join(testDir, entry))
212+
}
210213

211214
// Reverse for faster iteration times because many of the more interesting tests come last
212215
return files.reverse()
@@ -334,17 +337,11 @@ async function checkBuildAPI({ esbuild, file, content, yaml }) {
334337
throw error
335338
}
336339

337-
// Don't evaluate files in the "staging" or "intl402" areas
338-
const relPath = path.relative(testDir, file)
339-
if (relPath.startsWith('staging') || relPath.startsWith('intl402')) {
340-
return
341-
}
342-
343340
// Don't evaluate problematic files
344341
const hasDirectEval = result.warnings.some(msg => msg.id === 'direct-eval')
345342
if (
346343
hasDirectEval ||
347-
skipEvaluatingTheseTests.has(relPath) ||
344+
skipEvaluatingTheseTests.has(path.relative(testDir, file)) ||
348345
(yaml.includes && yaml.includes.some(include => skipEvaluatingTheseIncludes.has(include))) ||
349346
(yaml.features && yaml.features.some(feature => skipEvaluatingTheseFeatures.has(feature)))
350347
) {
@@ -421,8 +418,7 @@ async function main() {
421418
console.log(`Found ${files.length} test files`)
422419

423420
console.log(`\n${dimColor}Installing esbuild...${resetColor}`)
424-
// const esbuild = installForTests()
425-
const esbuild = require('/tmp/esbuild-xfrtyp2495b/node_modules/esbuild')
421+
const esbuild = installForTests()
426422

427423
console.log(`\n${dimColor}Running tests...${resetColor}\n`)
428424
const errorCounts = {}
@@ -465,15 +461,15 @@ async function main() {
465461
for (const kind of Object.keys(errorCounts).sort()) {
466462
table.push([kind + ' errors', `${errorCounts[kind]}`])
467463
}
464+
const seconds = (Date.now() - startTime) / 1000
465+
const minutes = Math.floor(seconds / 60)
466+
table.push(['Time taken', `${minutes ? `${minutes} min ${+(seconds - minutes * 60).toFixed(1)} sec` : `${+seconds.toFixed(1)} sec`}`])
468467
const maxLength = Math.max(...table.map(x => x[0].length))
468+
printNewlineWhenErasing = true
469469
process.stdout.write(eraseProgressBar())
470470
for (const [key, value] of table) {
471471
console.log(`${boldColor}${(key + ':').padEnd(maxLength + 1)}${resetColor} ${value}`)
472472
}
473-
474-
const seconds = (Date.now() - startTime) / 1000
475-
const minutes = Math.floor(seconds / 60)
476-
table.push(['Time taken', `${minutes ? `${minutes} min ${+(seconds - minutes * 60).toFixed(1)} sec` : `${+seconds.toFixed(1)} sec`}`])
477473
}
478474

479475
function forEachInParallel(items, batchSize, callback) {

0 commit comments

Comments
 (0)