Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gmock_output_test Namespace Reference

Classes

class  GMockOutputTest
 

Functions

def ToUnixLineEnding
 
def RemoveReportHeaderAndFooter
 
def RemoveLocations
 
def NormalizeErrorMarker
 
def RemoveMemoryAddresses
 
def RemoveTestNamesOfLeakedMocks
 
def GetLeakyTests
 
def GetNormalizedOutputAndLeakyTests
 
def GetShellCommandOutput
 
def GetNormalizedCommandOutputAndLeakyTests
 

Variables

string __author__ 'wan@google.com (Zhanyong Wan)'
 
string GENGOLDEN_FLAG '--gengolden'
 
tuple PROGRAM_PATH gmock_test_utils.GetTestExecutablePath('gmock_output_test_')
 
list COMMAND [PROGRAM_PATH, '--gtest_stack_trace_depth=0', '--gtest_print_time=0']
 
string GOLDEN_NAME 'gmock_output_test_golden.txt'
 
tuple GOLDEN_PATH os.path.join(gmock_test_utils.GetSourceDir(), GOLDEN_NAME)
 
tuple golden_file open(GOLDEN_PATH, 'wb')
 

Function Documentation

def gmock_output_test.GetLeakyTests (   output)
Returns a list of test names that leak mock objects.

Definition at line 110 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 110 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.GetNormalizedCommandOutputAndLeakyTests (   cmd)
Runs a command and returns its normalized output and a list of leaky tests.

Args:
  cmd:  the shell command.

Definition at line 144 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 144 of file gmock_output_test.py

References GetNormalizedOutputAndLeakyTests(), and GetShellCommandOutput().

Referenced by gmock_output_test.GMockOutputTest.testOutput().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gmock_output_test.GetNormalizedOutputAndLeakyTests (   output)
Normalizes the output of gmock_output_test_.

Args:
  output: The test output.

Returns:
  A tuple (the normalized test output, the list of test names that have
  leaked mocks).

Definition at line 119 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 119 of file gmock_output_test.py

References GetLeakyTests(), NormalizeErrorMarker(), RemoveLocations(), RemoveMemoryAddresses(), RemoveReportHeaderAndFooter(), RemoveTestNamesOfLeakedMocks(), and ToUnixLineEnding().

Referenced by GetNormalizedCommandOutputAndLeakyTests().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gmock_output_test.GetShellCommandOutput (   cmd)
Runs a command in a sub-process, and returns its STDOUT in a string.

Definition at line 138 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 138 of file gmock_output_test.py

References gmock_test_utils.Subprocess.

Referenced by GetNormalizedCommandOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.NormalizeErrorMarker (   output)
Normalizes the error marker, which is different on Windows vs on Linux.

Definition at line 92 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 92 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.RemoveLocations (   output)
Removes all file location info from a Google Test program's output.

Args:
     output:  the output of a Google Test program.

Returns:
     output with all file location info (in the form of
     'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
     'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
     'FILE:#: '.

Definition at line 76 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 76 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.RemoveMemoryAddresses (   output)
Removes memory addresses from the test output.

Definition at line 98 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 98 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.RemoveReportHeaderAndFooter (   output)
Removes Google Test result report's header and footer from the output.

Definition at line 65 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 65 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.RemoveTestNamesOfLeakedMocks (   output)
Removes the test names of leaked mock objects from the test output.

Definition at line 104 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 104 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

def gmock_output_test.ToUnixLineEnding (   s)
Changes all Windows/Mac line endings in s to UNIX line endings.

Definition at line 59 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 59 of file gmock_output_test.py

Referenced by GetNormalizedOutputAndLeakyTests().

+ Here is the caller graph for this function:

Variable Documentation

string gmock_output_test.__author__ 'wan@google.com (Zhanyong Wan)'

Definition at line 41 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 41 of file gmock_output_test.py

list gmock_output_test.COMMAND [PROGRAM_PATH, '--gtest_stack_trace_depth=0', '--gtest_print_time=0']

Definition at line 54 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 54 of file gmock_output_test.py

string gmock_output_test.GENGOLDEN_FLAG '--gengolden'

Definition at line 51 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 51 of file gmock_output_test.py

tuple gmock_output_test.golden_file open(GOLDEN_PATH, 'wb')

Definition at line 176 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 176 of file gmock_output_test.py

string gmock_output_test.GOLDEN_NAME 'gmock_output_test_golden.txt'

Definition at line 55 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 55 of file gmock_output_test.py

tuple gmock_output_test.GOLDEN_PATH os.path.join(gmock_test_utils.GetSourceDir(), GOLDEN_NAME)

Definition at line 56 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 56 of file gmock_output_test.py

tuple gmock_output_test.PROGRAM_PATH gmock_test_utils.GetTestExecutablePath('gmock_output_test_')

Definition at line 53 of file gmock_output_test.py.

View newest version in sPHENIX GitHub at line 53 of file gmock_output_test.py