This is an archive of the discontinued LLVM Phabricator instance.

[lit] Fix compatibility with upstream gtest
ClosedPublic

Authored by lzaoral on Apr 7 2021, 9:04 AM.

Details

Summary

Upstream gtest now prints 'Running main() from FILE' instead of
plain 'Running main() from gtest_main.cc'. Thus, all such tests
ended-up being mistakenly marked as UNRESOLVED.

Diff Detail

Event Timeline

lzaoral created this revision.Apr 7 2021, 9:04 AM
lzaoral requested review of this revision.Apr 7 2021, 9:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2021, 9:04 AM

LGTM but I don't feel authoritative for the lit code.

delcypher added inline comments.May 20 2021, 10:30 PM
llvm/utils/lit/lit/formats/googletest.py
62

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.

llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py
10–11

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
...
lzaoral updated this revision to Diff 353189.Jun 19 2021, 5:42 AM

Fix comments by @delcypher.

delcypher accepted this revision.Dec 12 2021, 8:23 PM

LGTM. Thanks for pinging.

This revision is now accepted and ready to land.Dec 12 2021, 8:23 PM

Thanks a lot @delcypher! Can you (or anyone else with commit rights) commit it to trunk for me?

Ping. I've got the same problem and I would like this fix to become effective.

Thanks a lot @delcypher! Can you (or anyone else with commit rights) commit it to trunk for me?

@lzaoral do you have a github account so we can attribute this to you?

Yes, @probinson. login: lzaoral mail: lzaoral[at]redhat.com Thanks!

This revision was automatically updated to reflect the committed changes.