diff --git a/llvm/utils/lit/lit/formats/googletest.py b/llvm/utils/lit/lit/formats/googletest.py --- a/llvm/utils/lit/lit/formats/googletest.py +++ b/llvm/utils/lit/lit/formats/googletest.py @@ -55,7 +55,7 @@ for ln in output.splitlines(False): # Don't keep newlines. ln = lit.util.to_string(ln) - if 'Running main() from gtest_main.cc' in ln: + if 'Running main() from ' in ln: # Upstream googletest prints this to stdout prior to running # tests. LLVM removed that print statement in r61540, but we # handle it here in case upstream googletest is being used. diff --git a/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py --- a/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py +++ b/llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os import sys if len(sys.argv) != 2: @@ -7,14 +8,14 @@ if sys.argv[1] == "--gtest_list_tests": print("""\ -Running main() from gtest_main.cc +Running main() from %s/gtest_main.cc FirstTest. subTestA subTestB ParameterizedTest/0. subTest ParameterizedTest/1. - subTest""") + subTest""" % os.getcwd()) sys.exit(0) elif not sys.argv[1].startswith("--gtest_filter="): raise ValueError("unexpected argument: %r" % (sys.argv[1]))