( name: string, repoURL: string, subPaths: string[] )
| 539 | }; |
| 540 | |
| 541 | function bootstrapParserTests( |
| 542 | name: string, |
| 543 | repoURL: string, |
| 544 | subPaths: string[] |
| 545 | ) { |
| 546 | function getParserTestsCommit(id: string): string { |
| 547 | const content = readFileSync("./Makefile", "utf8"); |
| 548 | const commit = new RegExp(`${id}_COMMIT = (\\w{40})`).exec(content)![1]; |
| 549 | if (!commit) throw new Error(`Could not find ${id}_COMMIT in Makefile`); |
| 550 | return commit; |
| 551 | } |
| 552 | |
| 553 | const dir = "./build/" + name.toLowerCase(); |
| 554 | |
| 555 | shell.rm("-rf", dir); |
| 556 | console.log("mkdir -p build"); |
| 557 | mkdirSync("build", { recursive: true }); |
| 558 | |
| 559 | exec("git", [ |
| 560 | "clone", |
| 561 | "--filter=blob:none", |
| 562 | "--sparse", |
| 563 | "--depth", |
| 564 | "1", |
| 565 | "--revision=" + getParserTestsCommit(name), |
| 566 | repoURL, |
| 567 | dir, |
| 568 | ]); |
| 569 | |
| 570 | exec("git", ["sparse-checkout", "set", ...subPaths], dir); |
| 571 | } |
| 572 | |
| 573 | target["bootstrap-test262"] = function () { |
| 574 | bootstrapParserTests("TEST262", "https://github.com/tc39/test262.git", [ |
no test coverage detected