[PATCH] [mach-o] wire up a dylib's install-name in more places

Tim Northover t.p.northover at gmail.com
Wed Jul 2 13:45:34 PDT 2014


>> I don't think that would test the same thing. It would test the YAML
>> -> NormalizedFile path instead of Binary -> NormalizedFile.
>
> That is ok.  We have (C++) unit tests to test Binary -> NormalizedFile. If there
> is any issues there, those tests should catch it (and enhanced if they don’t
> current test something there).

I don't think that's ok (at all!). Those tests contain things like:

    TEST(BinaryReaderTest, hello_obj_ppc) {
      const uint8_t fileBytes[] = {
        0xFE, 0xED, 0xFA, 0xCE, 0x00, 0x00, 0x00, 0x12,
        [...]
      };
      std::unique_ptr<NormalizedFile> f =
          fromBinary(fileBytes, sizeof(fileBytes), "ppc");

That strikes me as worse than committing a binary, let alone
generating a binary from YAML and testing it.

It has the advantage that you can test each field before it goes
through the linking process, I suppose. But if we're going to test
some representation in that way, wouldn't YAML be the obvious choice?
(So humans *can* understand and modify the tests if necessary).

Tim.




More information about the llvm-commits mailing list