diff --git a/test262/per-file/main.js b/test262/per-file/main.js index 02f3d76..6d4c7e7 100644 --- a/test262/per-file/main.js +++ b/test262/per-file/main.js @@ -67,7 +67,7 @@ function generateResults() { Object.keys(results.results).map((name) => [ name, { [results.results[name]]: 1 }, - ]) + ]), ); return; @@ -80,7 +80,7 @@ function generateResults() { for (const name in results.children) { const childResults = results.children[name]; results.aggregatedResults = Object.keys( - childResults.aggregatedResults + childResults.aggregatedResults, ).reduce((acc, mode) => { if (!(mode in acc)) acc[mode] = {}; const modeAcc = acc[mode]; @@ -109,7 +109,7 @@ function generateResults() { summaryStatusLabel = document.getElementById("summary-status"); leafTreeNodeTemplate = document.getElementById("leaf-tree-node-template"); nonLeafTreeNodeTemplate = document.getElementById( - "nonleaf-tree-node-template" + "nonleaf-tree-node-template", ); // Now make a nice lazy-loaded collapsible tree in `resultsNode`. @@ -192,7 +192,7 @@ function navigate() { history.pushState( { pathInTree }, pathInTree[pathInTree.length - 1], - generateQueryString(pathInTree) + generateQueryString(pathInTree), ); regenerateResults(resultsNode); } @@ -235,10 +235,10 @@ function generateChildNode(childName, child, filepath) { childNode.querySelector(".tree-node-name").textContent = childName; childNode.querySelector(".tree-node-name").title = filepath; childNode.querySelector(".tree-node-status").innerHTML = generateStatus( - child.aggregatedResults + child.aggregatedResults, ); childNode.querySelector(".tree-node-github-url").href = - window.config.generateGitHubURLFromTestPath(filepath); + window.config.generateGitHubURLFromTestPath(filepath, childName); return childNode; } @@ -266,12 +266,12 @@ let checkASTOnly = true; function entryHasFilteredResultType([, child]) { if (checkASTOnly && "AST" in child.aggregatedResults) { return Object.keys(child.aggregatedResults.AST).some((type) => - shownResultTypes.has(type) + shownResultTypes.has(type), ); } return Object.values(child.aggregatedResults).some((testType) => - Object.keys(testType).some((type) => shownResultTypes.has(type)) + Object.keys(testType).some((type) => shownResultTypes.has(type)), ); } @@ -294,7 +294,7 @@ function regenerateResults(targetNode) { const childNode = generateChildNode( childName, child, - `${pathInTree.join("/")}/${childName}` + `${pathInTree.join("/")}/${childName}`, ); const isLeaf = child.children === null; @@ -320,7 +320,7 @@ function regenerateResults(targetNode) { const childrenResults = searchResults( child.children, false, - relativePath + "/" + relativePath + "/", ); if (isSearchedFor) childrenResults.push([childName, child, relativePath]); @@ -348,7 +348,7 @@ function regenerateResults(targetNode) { const childrenResults = filterInternal( child.children, isSearchedFor, - relativePath + "/" + relativePath + "/", ); if (!isSearchedFor && childrenResults.length === 0 && !allChildren) return []; @@ -361,7 +361,7 @@ function regenerateResults(targetNode) { let results = filterInternal( result, - pathInTree.join("/").toLowerCase().includes(needle) + pathInTree.join("/").toLowerCase().includes(needle), ); while (results.length === 1 && results[0][3] !== null) @@ -380,7 +380,7 @@ function regenerateResults(targetNode) { const childNode = generateChildNode( childName, child, - `${pathInTree.join("/")}/${relativePath}` + `${pathInTree.join("/")}/${relativePath}`, ); if (child.children !== null) { @@ -436,7 +436,7 @@ function generateStatus(aggregatedResults) { const stats = aggregatedResults[mode]; const total = Object.keys(stats).reduce( (acc, name) => acc + stats[name], - 0 + 0, ); if (total === 0) return acc; acc.push(`
@@ -463,7 +463,7 @@ document.addEventListener("DOMContentLoaded", () => { promises.push( fetchData(path) .then((response) => response.json()) - .then((data) => initialize(data, mode)) + .then((data) => initialize(data, mode)), ); } Promise.all(promises).then(() => generateResults()); diff --git a/wasm/per-file/index.html b/wasm/per-file/index.html index 7ad561a..960348e 100644 --- a/wasm/per-file/index.html +++ b/wasm/per-file/index.html @@ -1,4 +1,4 @@ - + @@ -60,10 +60,12 @@

Per-file results

window.config = { initialPathInTree: "Spec", loadPathsAndModes: [["wasm/per-file-master.json", "Default"]], - generateGitHubURLFromTestPath(filepath) { + generateGitHubURLFromTestPath(filepath, testName) { const result = /^Spec\/(.*)\.js\/[^:]*::(.*)*$/.exec(filepath); if (!result) return ""; - return `https://github.com/WebAssembly/testsuite/blob/main/${result[1]}.wast`; + const lineNumber = /\(line (\d+)\)$/.exec(testName); + const line = lineNumber ? `#L${lineNumber[1]}` : ""; + return `https://github.com/WebAssembly/testsuite/blob/main/${result[1]}.wast${line}`; }, };