[CMake] "unit" testing your CMakeLists.txt

Philip Lowman philip at yhbt.com
Wed Feb 11 01:28:33 EST 2009


On Wed, Feb 11, 2009 at 1:03 AM, Tyler Roscoe <tyler at cryptio.net> wrote:

> Bumping this one time. Any thoughts? Is there a better place to ask this
> sort of question?


Sorry, my eyes glazed over the first time I read this sentence and I think I
was pretty tired so not knowing what these acronyms went I think I just
archived the thread.

> OTOH, it would be nice to gain some of the benefits of TDD (e.g.,
> fearless refactoring) in the build system

> One approach I've thought of is a simple script that simply makes
> > sure that each CMake project deposits an expected list of files in a
> > certain place. I have a hierarchy of "buildables" so it might be nice to
> > know that the header at the bottom of the dependency tree is built
> > correctly, and that the libraries that use it find that header and build
> > correctly, and that the executable that use those libraries find
> > everything and build correctly.
> >
> > Does anyone do anything like this? Are there tools around to help? Is
> > this a worthwhile thing to think about?
>

If you want to guarantee your library works externally as shipped you could
effect a "make install" and then build your test code against the "make
installed" copy of the library.  I'm not sure how many issues you'd discover
this way though, perhaps the occasional header file someone forgot to add to
the INSTALL list if your unit tests are good enough?  Not sure if it would
be worth it.


-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090211/8791cd07/attachment.htm>


More information about the CMake mailing list