MCPcopy Index your code
hub / github.com/nodejs/node / Main

Function Main

tools/test.py:1643–1865  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1641 return "on" if pointer_compression == "1" else "off"
1642
1643def Main():
1644 parser = BuildOptions()
1645 (options, args) = parser.parse_known_args()
1646 if not ProcessOptions(options):
1647 parser.print_help()
1648 return 1
1649
1650 stream = sys.stdout
1651 try:
1652 sys.stdout.reconfigure(encoding='utf8')
1653 except AttributeError:
1654 # Python < 3.7 does not have reconfigure
1655 stream = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
1656 ch = logging.StreamHandler(stream)
1657 logger.addHandler(ch)
1658 logger.setLevel(logging.INFO)
1659 if options.logfile:
1660 fh = logging.FileHandler(options.logfile, encoding='utf-8', mode='w')
1661 logger.addHandler(fh)
1662
1663 workspace = abspath(join(dirname(sys.argv[0]), '..'))
1664 test_root = join(workspace, 'test')
1665 if options.test_root is not None:
1666 test_root = options.test_root
1667 suites = GetSuites(test_root)
1668 repositories = [TestRepository(join(test_root, name)) for name in suites]
1669 repositories += [TestRepository(a) for a in options.suite]
1670
1671 root = LiteralTestSuite(repositories, test_root)
1672 paths = ArgsToTestPaths(test_root, args, suites)
1673
1674 # Check for --valgrind option. If enabled, we overwrite the special
1675 # command flag with a command that uses the run-valgrind.py script.
1676 if options.valgrind:
1677 run_valgrind = join(workspace, "tools", "run-valgrind.py")
1678 options.special_command = "python -u " + run_valgrind + " @"
1679
1680 if options.check_deopts:
1681 options.node_args.append("--trace-opt")
1682 options.node_args.append("--trace-file-names")
1683 options.progress = "deopts"
1684
1685 if options.worker:
1686 run_worker = join(workspace, "tools", "run-worker.js")
1687 options.node_args.append(run_worker)
1688
1689 processor = GetSpecialCommandProcessor(options.special_command)
1690
1691 context = Context(workspace,
1692 VERBOSE,
1693 options.shell,
1694 options.node_args,
1695 options.expect_fail,
1696 options.timeout,
1697 processor,
1698 options.suppress_dialogs,
1699 options.store_unexpected_output,
1700 options.repeat,

Callers 1

test.pyFile · 0.70

Calls 15

GetTestStatusMethod · 0.95
GetVmMethod · 0.95
ListTestsMethod · 0.95
ClassifyTestsMethod · 0.95
joinFunction · 0.90
dirnameFunction · 0.90
ProcessOptionsFunction · 0.85
abspathFunction · 0.85
GetSuitesFunction · 0.85
TestRepositoryClass · 0.85
LiteralTestSuiteClass · 0.85
ArgsToTestPathsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…