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

Method _setup_env

deps/v8/tools/testrunner/base_runner.py:469–529  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

467 pass # pragma: no cover
468
469 def _setup_env(self):
470 # Use the v8 root as cwd as some test cases use "load" with relative paths.
471 os.chdir(self.basedir)
472
473 # Many tests assume an English interface.
474 os.environ['LANG'] = 'en_US.UTF-8'
475
476 symbolizer_option = self._get_external_symbolizer_option()
477
478 if self.build_config.asan:
479 asan_options = [
480 symbolizer_option,
481 'allow_user_segv_handler=1',
482 'allocator_may_return_null=1',
483 ]
484 if self.build_config.component_build:
485 # Some abseil symbols are observed as defined more than once in
486 # component builds.
487 asan_options += ['detect_odr_violation=0']
488 if not utils.GuessOS() in ['macos', 'windows']:
489 # LSAN is not available on mac and windows.
490 asan_options.append('detect_leaks=1')
491 else:
492 asan_options.append('detect_leaks=0')
493 if utils.GuessOS() == 'windows':
494 # https://crbug.com/967663
495 asan_options.append('detect_stack_use_after_return=0')
496 os.environ['ASAN_OPTIONS'] = ":".join(asan_options)
497
498 if self.build_config.cfi:
499 os.environ['UBSAN_OPTIONS'] = ":".join([
500 'print_stacktrace=1',
501 'print_summary=1',
502 'symbolize=1',
503 symbolizer_option,
504 ])
505
506 if self.build_config.ubsan:
507 os.environ['UBSAN_OPTIONS'] = ":".join([
508 'print_stacktrace=1',
509 symbolizer_option,
510 ])
511
512 if self.build_config.msan:
513 os.environ['MSAN_OPTIONS'] = symbolizer_option
514
515 if self.build_config.tsan:
516 suppressions_file = (
517 self.basedir / 'tools' / 'sanitizers' / 'tsan_suppressions.txt')
518 os.environ['TSAN_OPTIONS'] = " ".join([
519 symbolizer_option,
520 'suppressions=%s' % suppressions_file,
521 'exit_code=0',
522 'report_thread_leaks=0',
523 'history_size=7',
524 'report_destroy_locked=0',
525 ])
526

Callers 1

executeMethod · 0.95

Calls 4

chdirMethod · 0.80
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected