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

Function bootstrapParserTests

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

Source from the content-addressed store, hash-verified

539};
540
541function 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
573target["bootstrap-test262"] = function () {
574 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