(args)
Merge two sancov files.

  Called trough multiprocessing pool. The args are expected to unpack to:
    swarming_output_dir: Folder where to find the new file.
    coverage_dir: Folder where to find the existing file.
    f: File name of the file to be merged.
Merge two sancov files.
Merge two sancov files .
def merge_two(args):
  """Merge two sancov files.

  Called trough multiprocessing pool. The args are expected to unpack to:
    swarming_output_dir: Folder where to find the new file.
    coverage_dir: Folder where to find the existing file.
    f: File name of the file to be merged.
  """
  swarming_output_dir, coverage_dir, f = args
  input_file = os.path.join(swarming_output_dir, f)
  output_file = os.path.join(coverage_dir, f)
  process = subprocess.Popen(
      [SANCOV_TOOL, 'merge', input_file, output_file],
      stdout=subprocess.PIPE,
      stderr=subprocess.PIPE,
  )
  output, _ = process.communicate()
  assert process.returncode == 0
  with open(output_file, "wb") as f:
    f.write(output)
def merge_two ( args ) : swarming_output_dir , coverage_dir , f = args input_file = os . path . join ( swarming_output_dir , f ) output_file = os . path . join ( coverage_dir , f ) process = subprocess . Popen ( [ SANCOV_TOOL , 'merge' , input_file , output_file ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE , ) output , _ = process . communicate ( ) assert process . returncode == 0 with open ( output_file , "wb" ) as f : f . write ( output )