class_docstr: Unit test for Google Test's JSON output functionality.
class_docstr_tok: ["Unit","test","for","Google","Test","'s","JSON","output","functionality","."]
docstr: Returns the JSON output generated by running the program gtest_prog_name.
  
  Furthermore, the program's exit code must be expected_exit_code.
  
  Args:
    gtest_prog_name: Google Test binary name.
    extra_args: extra arguments to binary invocation.
    expected_exit_code: program's exit code.
docstr_tok: ["Returns","the","JSON","output","generated","by","running","the","program","gtest_prog_name",".","Furthermore",",","the","program","'s","exit","code","must","be","expected_exit_code",".","Args",":","gtest_prog_name",":","Google","Test","binary","name",".","extra_args",":","extra","arguments","to","binary","invocation",".","expected_exit_code",":","program","'s","exit","code","."]
code: def _GetJsonOutput(
      self, gtest_prog_name, extra_args, expected_exit_code
  ):
      """Returns the JSON output generated by running the program gtest_prog_name.
  
      Furthermore, the program's exit code must be expected_exit_code.
  
      Args:
        gtest_prog_name: Google Test binary name.
        extra_args: extra arguments to binary invocation.
        expected_exit_code: program's exit code.
      """
      json_path = os.path.join(
          gtest_test_utils.GetTempDir(), gtest_prog_name + "out.json"
      )
      gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
          gtest_prog_name
      )
  
      command = [
          gtest_prog_path,
          "%s=json:%s" % (GTEST_OUTPUT_FLAG, json_path),
      ] + extra_args
      p = gtest_test_utils.Subprocess(command)
      if p.terminated_by_signal:
          self.assertTrue(
              False,
              "%s was killed by signal %d"
              % (gtest_prog_name, p.signal),
          )
      else:
          self.assertTrue(p.exited)
          self.assertEqual(
              expected_exit_code,
              p.exit_code,
              "'%s' exited with code %s, which doesn't match "
              "the expected exit code %s."
              % (command, p.exit_code, expected_exit_code),
          )
      with open(json_path) as f:
          actual = json.load(f)
      return actual
  
file_path: googletest/googletest/test/googletest-json-output-unittest.py
imports: import datetime
  import errno
  import json
  import os
  import re
  import sys
  from googletest.test import gtest_json_test_utils
  from googletest.test import gtest_test_utils
label_desc: Use image node_id 6 for calling the GTestJsonOutputUnitTest obj's underlying member method code with example usage: obj._GetJsonOutput(gtest_prog_name, extra_args, expected_exit_code) and returns: actual