parameters: (exe_name, benchmark_flags)
return_statement: return json_res
docstring: Run a benchmark specified by 'exe_name' with the specified
      'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
      real time console output.
      RETURNS: A JSON object representing the benchmark output
docstring_summary: Run a benchmark specified by 'exe_name' with the specified
      'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
      real time console output.
      RETURNS: A JSON object representing the benchmark output
docstring_tokens: Run a benchmark specified by exe_name with the specified benchmark_flags . The benchmark is run directly as a subprocess to preserve real time console output . RETURNS : A JSON object representing the benchmark output
function: def run_benchmark(exe_name, benchmark_flags):
      """
      Run a benchmark specified by 'exe_name' with the specified
      'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
      real time console output.
      RETURNS: A JSON object representing the benchmark output
      """
      output_name = find_benchmark_flag('--benchmark_out=',
                                        benchmark_flags)
      is_temp_output = False
      if output_name is None:
          is_temp_output = True
          thandle, output_name = tempfile.mkstemp()
          os.close(thandle)
          benchmark_flags = list(benchmark_flags) + \
                            ['--benchmark_out=%s' % output_name]
  
      cmd = [exe_name] + benchmark_flags
      print("RUNNING: %s" % ' '.join(cmd))
      exitCode = subprocess.call(cmd)
      if exitCode != 0:
          print('TEST FAILED...')
          sys.exit(exitCode)
      json_res = load_benchmark_results(output_name)
      if is_temp_output:
          os.unlink(output_name)
      return json_res
function_tokens: def run_benchmark ( exe_name , benchmark_flags ) : output_name = find_benchmark_flag ( '--benchmark_out=' , benchmark_flags ) is_temp_output = False if output_name is None : is_temp_output = True thandle , output_name = tempfile . mkstemp ( ) os . close ( thandle ) benchmark_flags = list ( benchmark_flags ) + [ '--benchmark_out=%s' % output_name ] cmd = [ exe_name ] + benchmark_flags print ( "RUNNING: %s" % ' ' . join ( cmd ) ) exitCode = subprocess . call ( cmd ) if exitCode != 0 : print ( 'TEST FAILED...' ) sys . exit ( exitCode ) json_res = load_benchmark_results ( output_name ) if is_temp_output : os . unlink ( output_name ) return json_res