Skip to content

Commit cf5dd30

Browse files
committed
wasm/per-file: Link to the exact line for tests that have the info
(cherry picked from commit dcae67dc3dd6d7f7aaf534cf7639b8cf99688344)
1 parent 288ffbc commit cf5dd30

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test262/per-file/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function generateChildNode(childName, child, filepath) {
238238
child.aggregatedResults
239239
);
240240
childNode.querySelector(".tree-node-github-url").href =
241-
window.config.generateGitHubURLFromTestPath(filepath);
241+
window.config.generateGitHubURLFromTestPath(filepath, childName);
242242
return childNode;
243243
}
244244

wasm/per-file/index.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ <h2>Per-file results</h2>
6060
window.config = {
6161
initialPathInTree: "Spec",
6262
loadPathsAndModes: [["wasm/per-file-master.json", "Default"]],
63-
generateGitHubURLFromTestPath(filepath) {
63+
generateGitHubURLFromTestPath(filepath, testName) {
6464
const result = /^Spec\/(.*)\.js\/[^:]*::(.*)*$/.exec(filepath);
6565
if (!result) return "";
66-
return `https://github.com/WebAssembly/testsuite/blob/main/${result[1]}.wast`;
66+
const lineNumber = /\(line (\d+)\)$/.exec(testName);
67+
const line = lineNumber ? `#L${lineNumber[1]}` : "";
68+
return `https://github.com/WebAssembly/testsuite/blob/main/${result[1]}.wast${line}`;
6769
},
6870
};
6971
</script>

0 commit comments

Comments
 (0)