Commit 6324796b authored by Gennadiy Civil's avatar Gennadiy Civil
Browse files

googletest-output-test changes

parent e69a1a83
...@@ -174,23 +174,24 @@ py_test( ...@@ -174,23 +174,24 @@ py_test(
) )
cc_binary( cc_binary(
name = "gtest_output_test_", name = "googletest-output-test_",
testonly = 1, testonly = 1,
srcs = ["gtest_output_test_.cc"], srcs = ["googletest-output-test_.cc"],
deps = ["//:gtest"], deps = ["//:gtest"],
) )
py_test( py_test(
name = "gtest_output_test", name = "googletest-output-test",
size = "small", size = "small",
srcs = ["gtest_output_test.py"], srcs = ["googletest-output-test.py"],
args = select({ args = select({
":has_absl": [], ":has_absl": [],
"//conditions:default": ["--no_stacktrace_support"], "//conditions:default": ["--no_stacktrace_support"],
}), }),
data = [ data = [
"gtest_output_test_golden_lin.txt", "googletest-output-test-golden-lin.txt",
":gtest_output_test_", ":googletest-output-test_",
], ],
deps = [":gtest_test_utils"], deps = [":gtest_test_utils"],
) )
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
SYNOPSIS SYNOPSIS
gtest_output_test.py --build_dir=BUILD/DIR --gengolden googletest_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest_output_test_ file. # where BUILD/DIR contains the built googletest-output-test_ file.
gtest_output_test.py --gengolden googletest_output_test.py --gengolden
gtest_output_test.py googletest_output_test.py
""" """
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
...@@ -59,9 +59,9 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' ...@@ -59,9 +59,9 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt' IS_WINDOWS = os.name == 'nt'
# TODO(vladl@google.com): remove the _lin suffix. # TODO(vladl@google.com): remove the _lin suffix.
GOLDEN_NAME = 'gtest_output_test_golden_lin.txt' GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_') PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
# At least one command we exercise must not have the # At least one command we exercise must not have the
# 'internal_skip_environment_and_ad_hoc_tests' argument. # 'internal_skip_environment_and_ad_hoc_tests' argument.
...@@ -104,7 +104,7 @@ def RemoveLocations(test_output): ...@@ -104,7 +104,7 @@ def RemoveLocations(test_output):
'FILE_NAME:#: '. 'FILE_NAME:#: '.
""" """
return re.sub(r'.*[/\\]((gtest_output_test_|gtest).cc)(\:\d+|\(\d+\))\: ', return re.sub(r'.*[/\\]((googletest-output-test_|gtest).cc)(\:\d+|\(\d+\))\: ',
r'\1:#: ', test_output) r'\1:#: ', test_output)
...@@ -195,7 +195,7 @@ def RemoveMatchingTests(test_output, pattern): ...@@ -195,7 +195,7 @@ def RemoveMatchingTests(test_output, pattern):
def NormalizeOutput(output): def NormalizeOutput(output):
"""Normalizes output (the output of gtest_output_test_.exe).""" """Normalizes output (the output of googletest-output-test_.exe)."""
output = ToUnixLineEnding(output) output = ToUnixLineEnding(output)
output = RemoveLocations(output) output = RemoveLocations(output)
...@@ -316,11 +316,11 @@ class GTestOutputTest(gtest_test_utils.TestCase): ...@@ -316,11 +316,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
if os.getenv('DEBUG_GTEST_OUTPUT_TEST'): if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
open(os.path.join( open(os.path.join(
gtest_test_utils.GetSourceDir(), gtest_test_utils.GetSourceDir(),
'_gtest_output_test_normalized_actual.txt'), 'wb').write( '_googletest-output-test_normalized_actual.txt'), 'wb').write(
normalized_actual) normalized_actual)
open(os.path.join( open(os.path.join(
gtest_test_utils.GetSourceDir(), gtest_test_utils.GetSourceDir(),
'_gtest_output_test_normalized_golden.txt'), 'wb').write( '_googletest-output-test_normalized_golden.txt'), 'wb').write(
normalized_golden) normalized_golden)
self.assertEqual(normalized_golden, normalized_actual) self.assertEqual(normalized_golden, normalized_actual)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment