[PATCH] D95232: Symbolizer - Teach symbolizer to work directly on object file.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 01:50:57 PST 2021
jhenderson added a comment.
In D95232#2571890 <https://reviews.llvm.org/D95232#2571890>, @pvellien wrote:
> In D95232#2567721 <https://reviews.llvm.org/D95232#2567721>, @jhenderson wrote:
>
>> I'm not sure if this is what @dblaikie was referring to, but it seems like a good way to test new public-facing APIs would be to write gtest unit tests. I don't think there's any precedent for this for the symbolizer API, so it may not be particularly easy. Refactoring llvm-symbolizer to make use of the new API is probably a good idea, and it may help with the test coverage, but there is a risk that a future refactor beyond that will cause llvm-symbolizer to no longer use the API, and therefore the test coverage is lost.
>
> @jhenderson so if we about to write unit tests for new symbolizer APIs how one should proceed? I would like to get your thoughts since there is no unit tests for Symbolizer
Sorry for the delay - I've got a very big workload currently and haven't had a chance to get through all review comments from the past week or so. You'd need to write CMakeLists.txt and add a source file for the tests, much like there already is in DebugInfoDWARFTests. You'd then likely want to identify some method to generate test inputs with the required properties. The exact nature of this would depend on what exactly you want to test, but two options might be to reuse the DwarfGenerator code in the DWARF tests, or to use YAML inputs as some other tests for libObject and other places do, to create the object. I can't really give you any more precise details than that, I'm afraid, as I don't know exactly the best way forward without spending time attempting it myself, but I hope these give you some ideas to start with.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95232/new/
https://reviews.llvm.org/D95232
More information about the llvm-commits
mailing list