proxygen
gtest_uninitialized_test Namespace Reference

Classes

class  GTestUninitializedTest
 

Functions

def Assert (condition)
 
def AssertEq (expected, actual)
 
def TestExitCodeAndOutput (command)
 

Variables

string __author__ = 'wan@google.com (Zhanyong Wan)'
 
 COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')
 

Function Documentation

def gtest_uninitialized_test.Assert (   condition)

Definition at line 42 of file gtest_uninitialized_test.py.

Referenced by TestExitCodeAndOutput().

42 def Assert(condition):
43  if not condition:
44  raise AssertionError
45 
46 
def gtest_uninitialized_test.AssertEq (   expected,
  actual 
)

Definition at line 47 of file gtest_uninitialized_test.py.

Referenced by TestExitCodeAndOutput().

47 def AssertEq(expected, actual):
48  if expected != actual:
49  print('Expected: %s' % (expected,))
50  print(' Actual: %s' % (actual,))
51  raise AssertionError
52 
53 
def AssertEq(expected, actual)
def gtest_uninitialized_test.TestExitCodeAndOutput (   command)
Runs the given command and verifies its exit code and output.

Definition at line 54 of file gtest_uninitialized_test.py.

References Assert(), and AssertEq().

Referenced by gtest_uninitialized_test.GTestUninitializedTest.testExitCodeAndOutput().

54 def TestExitCodeAndOutput(command):
55  """Runs the given command and verifies its exit code and output."""
56 
57  # Verifies that 'command' exits with code 1.
58  p = gtest_test_utils.Subprocess(command)
59  Assert(p.exited)
60  AssertEq(1, p.exit_code)
61  Assert('InitGoogleTest' in p.output)
62 
63 
def AssertEq(expected, actual)

Variable Documentation

string gtest_uninitialized_test.__author__ = 'wan@google.com (Zhanyong Wan)'
private

Definition at line 34 of file gtest_uninitialized_test.py.

gtest_uninitialized_test.COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_')

Definition at line 39 of file gtest_uninitialized_test.py.