Monero
Loading...
Searching...
No Matches
Classes | Functions | Variables
gmock_output_test Namespace Reference

Classes

class  GMockOutputTest
 

Functions

def ToUnixLineEnding (s)
 
def RemoveReportHeaderAndFooter (output)
 
def RemoveLocations (output)
 
def NormalizeErrorMarker (output)
 
def RemoveMemoryAddresses (output)
 
def RemoveTestNamesOfLeakedMocks (output)
 
def GetLeakyTests (output)
 
def GetNormalizedOutputAndLeakyTests (output)
 
def GetShellCommandOutput (cmd)
 
def GetNormalizedCommandOutputAndLeakyTests (cmd)
 

Variables

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

Detailed Description

Tests the text output of Google C++ Mocking Framework.

SYNOPSIS
       gmock_output_test.py --build_dir=BUILD/DIR --gengolden
         # where BUILD/DIR contains the built gmock_output_test_ file.
       gmock_output_test.py --gengolden
       gmock_output_test.py

Function Documentation

◆ GetLeakyTests()

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

◆ GetNormalizedCommandOutputAndLeakyTests()

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.

◆ GetNormalizedOutputAndLeakyTests()

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).

◆ GetShellCommandOutput()

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

◆ NormalizeErrorMarker()

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

◆ RemoveLocations()

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:#: '.

◆ RemoveMemoryAddresses()

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

◆ RemoveReportHeaderAndFooter()

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

◆ RemoveTestNamesOfLeakedMocks()

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

◆ ToUnixLineEnding()

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

Variable Documentation

◆ _

gmock_output_test._
protected

◆ __author__

str gmock_output_test.__author__ = 'wan@google.com (Zhanyong Wan)'
private

◆ COMMAND

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

◆ else

gmock_output_test.else :

◆ GENGOLDEN_FLAG

str gmock_output_test.GENGOLDEN_FLAG = '--gengolden'

◆ golden_file

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

◆ GOLDEN_NAME

str gmock_output_test.GOLDEN_NAME = 'gmock_output_test_golden.txt'

◆ GOLDEN_PATH

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

◆ output

gmock_output_test.output

◆ PROGRAM_PATH

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