On Tue, Apr 27, 2010 at 02:47:18PM +0100, Magnus Therning wrote:
> Except of course that it will take away one of the things I *really*
> want, which is that all unit tests are run every time I compile.

We run our unit tests with a python wrapper script that does some
environment configuration before running the test. We then add this
script as a post_build custom command so that the unit test runs after
it compiles.

        add_custom_command (TARGET ${PROJECT_NAME}
            POST_BUILD
            # Call the runner script directly. By doing it this way, all the
            # unit tests in the executable run at once. If we call CTest
            # here (like we do for the _runtest target), the script (and
            # thus the python interpreter) is invoked once for each test in
            # the executable, which is slower than calling the script once.
            COMMAND ${PYTHON_EXECUTABLE} ${${PROJECT_NAME}_TESTRUNNER} 
${CMAKE_CFG_INTDIR} --gtest_print_time
        )

hth,
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

Reply via email to