[CMake] --build-run-dir for CTest

Ioan Calin Borcoman iborco at gmail.com
Mon Jan 19 08:04:50 EST 2009


Hi,

Not sure if this helps, but here how I use the build dir:

* in the top CMakeLists.txt I have this:
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})

* tests are added as (this is done in the CMakeLists.txt that where
the sources for xxx1 are located, for example
src/tests/xxx1/CMakeLists.txt):
add_executable(xxx1 xxx1.cpp)
add_test(xxx1 ${EXECUTABLE_OUTPUT_PATH}/xxx1)

If I build the package in build/ (with cd build; cmake ..; make), I
end up with xxx1 in the build/ dir (the intermediate object files are
still located in build/src/tests/xxx1, just the final executable is
stored under build/).

With this scheme I was able to run unit-tests, do coverage and memory
testing and publish the results on the public CDash server.

Cheers,

Ionutz

On Mon, Jan 19, 2009 at 2:08 PM, Adolfo Rodríguez <dofo79 at gmail.com> wrote:
> Hi all,
>
> This is my first post to the list.
>
> My question, I believe, is the same one that Tron Thomas recently posted,
> and still remains unanswered in the list:
>
> What is the --build-run-dir for CTest supposed to do?
>
> I tried to use it to run a unit test from a specific directory and that did
> not work.
>
> How can someone specify the working directory for a unit test?
>
> Or stated otherwise, does CTest provide a mechanism for specifying the
> working directory of a test executable?, as opposed to what the add_test
> command specifies by default: "The test will be run with the current working
> directory set to the CMakeList.txt files corresponding directory in the
> binary tree."
>
> I am using CMake/CTest 2.6 pathch 0, as distributed by OpenSUSE.
>
> Thanks in advance,
>
> Adolfo Rodríguez Tsouroukdissian
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list