MCPcopy Create free account
hub / github.com/babel/babel / bootstrapParserTests

Function bootstrapParserTests

Makefile.source.ts:477–507  ·  view source on GitHub ↗
(
  name: string,
  repoURL: string,
  subPaths: string[]
)

Source from the content-addressed store, hash-verified

475};
476
477function bootstrapParserTests(
478 name: string,
479 repoURL: string,
480 subPaths: string[]
481) {
482 function getParserTestsCommit(id: string): string {
483 const content = readFileSync("./Makefile", "utf8");
484 const commit = new RegExp(`${id}_COMMIT = (\\w{40})`).exec(content)![1];
485 if (!commit) throw new Error(`Could not find ${id}_COMMIT in Makefile`);
486 return commit;
487 }
488
489 const dir = "./build/" + name.toLowerCase();
490
491 shell.rm("-rf", dir);
492 console.log("mkdir -p build");
493 mkdirSync("build", { recursive: true });
494
495 exec("git", [
496 "clone",
497 "--filter=blob:none",
498 "--sparse",
499 "--depth",
500 "1",
501 "--revision=" + getParserTestsCommit(name),
502 repoURL,
503 dir,
504 ]);
505
506 exec("git", ["sparse-checkout", "set", ...subPaths], dir);
507}
508
509target["bootstrap-test262"] = function () {
510 bootstrapParserTests("TEST262", "https://github.com/tc39/test262.git", [

Callers 1

Makefile.source.tsFile · 0.85

Calls 2

execFunction · 0.85
getParserTestsCommitFunction · 0.85

Tested by

no test coverage detected