This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Remove TestingSupport's dependency on gtest
ClosedPublic

Authored by ymandel on Jan 14 2022, 4:59 AM.

Details

Summary

Users outside of the clang repo may use different googletest versions. So, it's
better not to depend on llvm's googletest. This patch removes the dependency by
having checkDataflow return an llvm::Error instead of calling googletest's
FAIL or ASSERT... macros.

Diff Detail

Event Timeline

ymandel requested review of this revision.Jan 14 2022, 4:59 AM
ymandel created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2022, 4:59 AM
gribozavr2 accepted this revision.Jan 16 2022, 1:58 PM
gribozavr2 added inline comments.
clang/unittests/Analysis/FlowSensitive/TestingSupport.h
144

any_cast already performs an assert.

This revision is now accepted and ready to land.Jan 16 2022, 1:58 PM
ymandel updated this revision to Diff 400543.Jan 17 2022, 7:18 AM

remove redundant assert.

This revision was landed with ongoing or failed builds.Jan 17 2022, 7:34 AM
This revision was automatically updated to reflect the committed changes.

Users outside of the clang repo may use different googletest versions.

I don't understand what that means.

Why does it matter what version outside users are using -- these are clang unit-tests, not a public API, right?

Why does it matter what version outside users are using -- these are clang unit-tests, not a public API, right?

clang/unittests/Analysis/FlowSensitive/TestingSupport.h is a public API for writing tests for dataflow analyses.