MCPcopy Create free account
hub / github.com/nodejs/node / maybe_parse_builddir

Method maybe_parse_builddir

deps/v8/tools/dev/gm.py:682–724  ·  view source on GitHub ↗
(self, argstring)

Source from the content-addressed store, hash-verified

680 self.populate_configs(DEFAULT_ARCHES, DEFAULT_MODES, **impact)
681
682 def maybe_parse_builddir(self, argstring):
683 outdir_prefix = str(OUTDIR_BASENAME) + os.path.sep
684 # {argstring} must have the shape "out/x", and the 'x' part must be
685 # at least one character.
686 if not argstring.startswith(outdir_prefix):
687 return False
688 if len(argstring) <= len(outdir_prefix):
689 return False
690 # "out/foo.d8" -> path="out/foo", targets=["d8"]
691 # "out/d8.cctest" -> path="out/d8", targets=["cctest"]
692 # "out/x.y.d8.cctest" -> path="out/x.y", targets=["d8", "cctest"]
693 argstring = argstring.replace(outdir_prefix, "")
694 words = argstring.split('.')
695 path_end = len(words)
696 targets = []
697 tests = []
698 clean = False
699 while path_end > 1:
700 w = words[path_end - 1]
701 maybe_target = get_test_binary(w)
702 if w in TARGETS:
703 targets.append(w)
704 elif maybe_target is not None:
705 targets.append(maybe_target)
706 tests.append(w)
707 elif w == 'clean':
708 clean = True
709 else:
710 break
711 path_end -= 1
712 targets = targets or DEFAULT_TARGETS
713 path = OUTDIR / Path('.'.join(words[:path_end]))
714 args_gn = path / "args.gn"
715 # Only accept existing build output directories, otherwise fall back
716 # to regular parsing.
717 if not args_gn.is_file():
718 return False
719 if path not in self.configs:
720 self.configs[path] = RawConfig(path, targets, tests, clean,
721 self.testrunner_args)
722 else:
723 self.configs[path].extend(targets, tests, clean)
724 return True
725
726 def parse_arg(self, argstring):
727 if argstring in ("-h", "--help", "help"):

Callers 1

parse_argMethod · 0.95

Calls 7

strFunction · 0.85
get_test_binaryFunction · 0.85
RawConfigClass · 0.85
splitMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected