[PATCH] D100043: [lit] Fix compatibility with upstream gtest

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 22:30:05 PDT 2021


delcypher added inline comments.


================
Comment at: llvm/utils/lit/lit/formats/googletest.py:58
 
-            if 'Running main() from gtest_main.cc' in ln:
+            if 'Running main() from ' in ln:
                 # Upstream googletest prints this to stdout prior to running
----------------
This should probably be a regex that can handle both the old and new output. We can't assume the version of GTest being used because lit is used outside of LLVM in other places. Given that the cost of support of both is relatively low here, we should probably just do it.


================
Comment at: llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py:11
     print("""\
-Running main() from gtest_main.cc
+Running main() from %s/gtest_main.cc
 FirstTest.
----------------
I'd prefer if you used f-strings here rather than string interpolation operator, i.e.

```
    print(f"""\
Running main() from {os.getcwd()}/gtest_main.cc
...
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100043/new/

https://reviews.llvm.org/D100043



More information about the llvm-commits mailing list