gtest_break_on_failure_unittest.py revision 41d0579e8de9ef4ff178fc4991043c61a19943f7
11be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#!/usr/bin/env python
21be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#
31be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# Copyright 2006, Google Inc.
41be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# All rights reserved.
51be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#
61be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# Redistribution and use in source and binary forms, with or without
71be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# modification, are permitted provided that the following conditions are
81be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# met:
91be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#
101be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#     * Redistributions of source code must retain the above copyright
111be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# notice, this list of conditions and the following disclaimer.
121be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#     * Redistributions in binary form must reproduce the above
131be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# copyright notice, this list of conditions and the following disclaimer
141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# in the documentation and/or other materials provided with the
151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# distribution.
161be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#     * Neither the name of Google Inc. nor the names of its
171be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# contributors may be used to endorse or promote products derived from
181be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# this software without specific prior written permission.
191be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#
201be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
211be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
221be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
231be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
241be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
251be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
261be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
271be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
281be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
291be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
301be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
321be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania"""Unit test for Google Test's break-on-failure mode.
331be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
341be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaA user can ask Google Test to seg-fault when an assertion fails, using
351be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaeither the GTEST_BREAK_ON_FAILURE environment variable or the
361be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania--gtest_break_on_failure flag.  This script tests such functionality
371be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaby invoking gtest_break_on_failure_unittest_ (a program written with
381be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaGoogle Test) with different environments and command line flags.
391be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania"""
401be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
411be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania__author__ = 'wan@google.com (Zhanyong Wan)'
421be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
431be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaimport gtest_test_utils
441be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaimport os
451be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaimport sys
461be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
471be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
481be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# Constants.
491be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
5041d0579e8de9ef4ff178fc4991043c61a19943f7Brett ChabotIS_WINDOWS = os.name == 'nt'
5141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
521be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# The environment variable for enabling/disabling the break-on-failure mode.
531be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaBREAK_ON_FAILURE_ENV_VAR = 'GTEST_BREAK_ON_FAILURE'
541be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
551be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# The command line flag for enabling/disabling the break-on-failure mode.
561be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaBREAK_ON_FAILURE_FLAG = 'gtest_break_on_failure'
571be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
581be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# The environment variable for enabling/disabling the throw-on-failure mode.
591be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTHROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
601be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
6141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot# The environment variable for enabling/disabling the catch-exceptions mode.
6241d0579e8de9ef4ff178fc4991043c61a19943f7Brett ChabotCATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS'
6341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
641be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# Path to the gtest_break_on_failure_unittest_ program.
6541d0579e8de9ef4ff178fc4991043c61a19943f7Brett ChabotEXE_PATH = gtest_test_utils.GetTestExecutablePath(
6641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    'gtest_break_on_failure_unittest_')
671be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
681be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
691be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# Utilities.
701be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
711be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
7241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabotenviron = os.environ.copy()
7341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
7441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
751be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniadef SetEnvVar(env_var, value):
761be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  """Sets an environment variable to a given value; unsets it when the
771be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  given value is None.
781be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  """
791be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
801be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  if value is not None:
8141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    environ[env_var] = value
8241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  elif env_var in environ:
8341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    del environ[env_var]
841be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
851be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniadef Run(command):
871be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  """Runs a command; returns 1 if it was killed by a signal, or 0 otherwise."""
881be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
8941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  p = gtest_test_utils.Subprocess(command, env=environ)
901be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  if p.terminated_by_signal:
911be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    return 1
921be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  else:
931be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    return 0
941be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
951be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
961be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania# The tests.
971be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
981be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
9941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabotclass GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
1001be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  """Tests using the GTEST_BREAK_ON_FAILURE environment variable or
1011be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  the --gtest_break_on_failure flag to turn assertion failures into
1021be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  segmentation faults.
1031be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  """
1041be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1051be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault):
1061be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Runs gtest_break_on_failure_unittest_ and verifies that it does
1071be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    (or does not) have a seg-fault.
1081be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1091be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    Args:
1101be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      env_var_value:    value of the GTEST_BREAK_ON_FAILURE environment
1111be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                        variable; None if the variable should be unset.
1121be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      flag_value:       value of the --gtest_break_on_failure flag;
1131be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                        None if the flag should not be present.
1141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      expect_seg_fault: 1 if the program is expected to generate a seg-fault;
1151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                        0 otherwise.
1161be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """
1171be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1181be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, env_var_value)
1191be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1201be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    if env_var_value is None:
1211be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      env_var_value_msg = ' is not set'
1221be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    else:
1231be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      env_var_value_msg = '=' + env_var_value
1241be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1251be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    if flag_value is None:
1261be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      flag = ''
1271be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    elif flag_value == '0':
1281be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      flag = '--%s=0' % BREAK_ON_FAILURE_FLAG
1291be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    else:
1301be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      flag = '--%s' % BREAK_ON_FAILURE_FLAG
1311be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1321be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    command = [EXE_PATH]
1331be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    if flag:
1341be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      command.append(flag)
1351be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1361be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    if expect_seg_fault:
1371be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      should_or_not = 'should'
1381be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    else:
1391be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      should_or_not = 'should not'
1401be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1411be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    has_seg_fault = Run(command)
1421be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1431be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
1441be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1451be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
1461be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania           (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
1471be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania            should_or_not))
1481be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.assert_(has_seg_fault == expect_seg_fault, msg)
1491be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1501be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def testDefaultBehavior(self):
1511be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Tests the behavior of the default mode."""
1521be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1531be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value=None,
1541be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value=None,
1551be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=0)
1561be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1571be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def testEnvVar(self):
1581be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Tests using the GTEST_BREAK_ON_FAILURE environment variable."""
1591be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1601be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='0',
1611be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value=None,
1621be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=0)
1631be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='1',
1641be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value=None,
1651be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=1)
1661be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1671be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def testFlag(self):
1681be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Tests using the --gtest_break_on_failure flag."""
1691be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1701be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value=None,
1711be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='0',
1721be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=0)
1731be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value=None,
1741be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='1',
1751be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=1)
1761be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1771be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def testFlagOverridesEnvVar(self):
1781be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Tests that the flag overrides the environment variable."""
1791be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1801be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='0',
1811be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='0',
1821be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=0)
1831be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='0',
1841be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='1',
1851be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=1)
1861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='1',
1871be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='0',
1881be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=0)
1891be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    self.RunAndVerify(env_var_value='1',
1901be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      flag_value='1',
1911be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                      expect_seg_fault=1)
1921be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1931be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  def testBreakOnFailureOverridesThrowOnFailure(self):
1941be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    """Tests that gtest_break_on_failure overrides gtest_throw_on_failure."""
1951be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1961be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    SetEnvVar(THROW_ON_FAILURE_ENV_VAR, '1')
1971be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    try:
1981be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      self.RunAndVerify(env_var_value=None,
1991be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                        flag_value='1',
2001be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania                        expect_seg_fault=1)
2011be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    finally:
2021be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania      SetEnvVar(THROW_ON_FAILURE_ENV_VAR, None)
2031be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
20441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  if IS_WINDOWS:
20541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    def testCatchExceptionsDoesNotInterfere(self):
20641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      """Tests that gtest_catch_exceptions doesn't interfere."""
20741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
20841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, '1')
20941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      try:
21041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot        self.RunAndVerify(env_var_value='1',
21141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot                          flag_value='1',
21241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot                          expect_seg_fault=1)
21341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      finally:
21441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot        SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, None)
21541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
21641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
2171be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaif __name__ == '__main__':
2181be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  gtest_test_utils.Main()
219