[PATCH] D108984: [WebAssembly][libObject] Avoid re-use of Section object during parsing

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 01:58:10 PDT 2021


sbc100 added a comment.

In D108984#2978931 <https://reviews.llvm.org/D108984#2978931>, @jhenderson wrote:

> In D108984#2976999 <https://reviews.llvm.org/D108984#2976999>, @dschuff wrote:
>
>> AFAIK we don't have gtest tests for wasm's lib/Object code so I don't want to block this little fix on creating a whole new set of tests. This change to the existing tests looks ok to me.
>> But I am interested in gtest unit tests more, because I like that style of testing generally.  e.g. gor the file-based tests we have YAML as a convenient way to create test input, but it seems like for gtest tests you'd have to duplicate or write some custom test-harness code to generate inputs. Do you know if there are existing unit tests for lib/Object code, or know of any best practices for testing that library?
>
> llvm/unittests/Object contains unittests for the Object library. Mostly, they're testing the easier to test API, but there are some, such as ELFObjectFileTest.cpp and MinidumpTest.cpp, which do similar things to what you might need to do to get wasm libObject tests sorted.

Interesting, it looks like they also use yaml2obj  to generate test input in the unit tests:
https://github.com/llvm/llvm-project/blob/dfb7518df18ad420984f965ef5ccfb4e126d839b/llvm/unittests/Object/ELFObjectFileTest.cpp#L318-L331

For now, I think I'm OK with leaving the testing here in the objcopy tests since that bug in question only effects objcopy (no other tools seem to care about the name of non-custom sections).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108984



More information about the llvm-commits mailing list