Skip to content

Commit

Permalink
wasm/per-file: Link to the exact line for tests that have the info
Browse files Browse the repository at this point in the history
(cherry picked from commit dcae67dc3dd6d7f7aaf534cf7639b8cf99688344)
  • Loading branch information
alimpfard committed Jul 10, 2024
1 parent 288ffbc commit cf5dd30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test262/per-file/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function generateChildNode(childName, child, filepath) {
child.aggregatedResults
);
childNode.querySelector(".tree-node-github-url").href =
window.config.generateGitHubURLFromTestPath(filepath);
window.config.generateGitHubURLFromTestPath(filepath, childName);
return childNode;
}

Expand Down
6 changes: 4 additions & 2 deletions wasm/per-file/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ <h2>Per-file results</h2>
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}`;
},
};
</script>
Expand Down

0 comments on commit cf5dd30

Please sign in to comment.