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

Method testArgs

deps/v8/tools/gcmole/gcmole_test.py:411–437  ·  view source on GitHub ↗

Test argument retrieval using a fake v8 file system and build dir.

(self)

Source from the content-addressed store, hash-verified

409class ArgsTest(unittest.TestCase):
410
411 def testArgs(self):
412 """Test argument retrieval using a fake v8 file system and build dir."""
413 with tempfile.TemporaryDirectory('gcmole_args_test') as temp_dir:
414 temp_dir = Path(temp_dir)
415 temp_out = temp_dir / 'out'
416 temp_gcmole = temp_dir / 'tools' / 'gcmole' / 'gcmole_args.py'
417
418 shutil.copytree(abs_test_file('out'), temp_out)
419 os.makedirs(temp_gcmole.parent)
420 shutil.copy(GCMOLE_PATH / 'gcmole_args.py', temp_gcmole)
421
422 # Simulate a ninja call relative to the build dir.
423 gn_sysroot = '//build/linux/debian_bullseye_amd64-sysroot'
424 subprocess.check_call(
425 [sys.executable, temp_gcmole, gn_sysroot], cwd=temp_out)
426
427 with open(temp_dir / 'out' / 'v8_gcmole.args') as f:
428 self.assertEqual(f.read().split(), [
429 '-DUSE_GLIB=1',
430 '-DV8_TARGET_ARCH_X64',
431 '-I.',
432 '-Iout/gen',
433 '-Iinclude',
434 '-Iout/gen/include',
435 '-isystem../buildtools/third_party/libc++/trunk/include',
436 '--sysroot=build/linux/debian_bullseye_amd64-sysroot',
437 ])
438
439
440if __name__ == '__main__':

Callers

nothing calls this directly

Calls 5

abs_test_fileFunction · 0.85
copyMethod · 0.65
openFunction · 0.50
splitMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected