Re: [CMake] unit testing your CMakeLists.txt
2009/2/11 Tyler Roscoe ty...@cryptio.net: Bumping this one time. Any thoughts? Is there a better place to ask this sort of question? Just wanted to say that I'm interested too, so I'd follow any discussion with interest. Best regards Hugo Heden Thanks, tyler On Mon, Feb 09, 2009 at 12:15:33PM -0800, Tyler Roscoe wrote: My company is adopting Test-Driven Development. I am wondering if any of you build engineers in a similar position have given any thought to how one might use this approach when developing your build systems. In one sense, you can say, Well, the build is the test. If I say 'go' and I end up with SuperProduct.exe (and maybe a bunch of unit test successes) then everything works and I don't need any tests. OTOH, it would be nice to gain some of the benefits of TDD (e.g., fearless refactoring) in the build system. Sometimes there are build artifacts that should be generated which are not code and therefore won't generate build errors (documentation perhaps). 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? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] unit testing your CMakeLists.txt
On Monday 09 February 2009 20:15:33 Tyler Roscoe wrote: Does anyone do anything like this? Are there tools around to help? Is this a worthwhile thing to think about? I think this shouldn't be separate from the rest of your other TDD stuff that the non-buildsystem developers are doing. In my mind TDD makes no sense without a continuous integration system and this means your packaging should be integrated into the buildsystem so that every revision that is committed is built, tested and packaged and any other tasks are run (e.g. documentation generation). You can and should just set up the continuous integration system to ensure these stages are completed successfully (such as get it actually running the packaged installer and the like). Really I think going much beyond this is a bit overkill. We're dealing with a pretty complex project with external dependencies, multiple platforms/architectures and automatic packaging and subtle bugs just don't tend to creep into the buildsystem in the same way that they do with our C++ code. I think the only real important thing from the buildsystem is the result and therefore just making sure the application can be run correctly should be enough. -- Cheers, Mike Arthur http://mikearthur.co.uk/ ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] unit testing your CMakeLists.txt
Mike Arthur wrote: On Monday 09 February 2009 20:15:33 Tyler Roscoe wrote: Does anyone do anything like this? Are there tools around to help? Is this a worthwhile thing to think about? I think this shouldn't be separate from the rest of your other TDD stuff that the non-buildsystem developers are doing. You should look at CDash www.cdash.org, and CTest which is bundled with CMake. Combined they make a very good continuous integration system. If you created some custom targets that ran ctest with each build you could easily have a TDD system built on CMake. See add_test command. Here are some links: http://www.cmake.org/Wiki/CMake_Testing_With_CTest http://www.kitware.com/solutions/softwareprocess.html http://www.cmake.org/cmake/img/software-process.png -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] unit testing your CMakeLists.txt
Bumping this one time. Any thoughts? Is there a better place to ask this sort of question? Thanks, tyler On Mon, Feb 09, 2009 at 12:15:33PM -0800, Tyler Roscoe wrote: My company is adopting Test-Driven Development. I am wondering if any of you build engineers in a similar position have given any thought to how one might use this approach when developing your build systems. In one sense, you can say, Well, the build is the test. If I say 'go' and I end up with SuperProduct.exe (and maybe a bunch of unit test successes) then everything works and I don't need any tests. OTOH, it would be nice to gain some of the benefits of TDD (e.g., fearless refactoring) in the build system. Sometimes there are build artifacts that should be generated which are not code and therefore won't generate build errors (documentation perhaps). 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? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] unit testing your CMakeLists.txt
On Wed, Feb 11, 2009 at 1:03 AM, Tyler Roscoe ty...@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 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] unit testing your CMakeLists.txt
My company is adopting Test-Driven Development. I am wondering if any of you build engineers in a similar position have given any thought to how one might use this approach when developing your build systems. In one sense, you can say, Well, the build is the test. If I say 'go' and I end up with SuperProduct.exe (and maybe a bunch of unit test successes) then everything works and I don't need any tests. OTOH, it would be nice to gain some of the benefits of TDD (e.g., fearless refactoring) in the build system. Sometimes there are build artifacts that should be generated which are not code and therefore won't generate build errors (documentation perhaps). 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? Thanks, tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake