Loading ...
Sorry, an error occurred while loading the content.

138434Re: Build systems for Unit Testing

Expand Messages
  • David Carlton
    Jan 28, 2008
    • 0 Attachment
      On Tue, 29 Jan 2008 11:23:49 +1300 (NZDT), John Carter <john.carter@...> said:

      > Turns out it has been a small sacrifice that enables extracting the
      > dependency 'net on _every_ build. ie. You never have to remember to
      > "make depend" and you can get the dependency 'net exactly right (apart
      > from that small simplification) every build. (I _know_ from experience
      > that has saved me countless, "John your dependency tracking is wrong"
      > groundless complaints.

      Yeah, separate 'make depend' steps are bad.

      > Then I use the exact same dependency tracking magic to go from a list
      > of defined and undefined symbols in the object files (generated by the
      > gcc/binutils "nm --extern" program) to a minimal list of object files
      > to feed to the linker to create an executable.

      > If the dependency net changes, no problem, it's all autogenerated.

      > Furthermore I can tweak that depending on whether I'm building a
      > unit test (present appropriate mocks to linker) or the real thing
      > (guarantee no test code ever)

      > Additional very nice things is I can catch and block bad practices (as
      > agreed on by the team) like cyclic dependencies in #include 'nets,
      > debug logging symbols in release builds, architectural layer smashing,
      > etc. etc. (I also provide (noisy) back doors on these blocks to allow
      > quick hack spike activity)

      Interesting, that's really cool! I'll have to keep that in my bag of
      tricks for the future.

      (Random trivia for build geeks: if you don't want to do dependencies
      every time, there's one correct time to do it: if you generate your
      dependencies exactly when you compile the file, then you'll always
      have your dependencies up to date without doing any more work than
      necessary. That might work with some of your other suggestions, but
      probably not all of them.)

      David Carlton
    • Show all 19 messages in this topic