# Specify nosetests working directory

According to this documentation, it is possible to specify a working directory for the nosetests. I want the nosetests to run in the build directory, so I tried the following:

catkin_add_nosetests(test WORKING_DIRECTORY \${PROJECT_BINARY_DIR})


This is not working, however. When I print the current directory in a nosetest using

print "working directory: ", os.path.abspath(os.path.curdir)


the result is still the source directory where the tests are defined.

I am still using groovy, so maybe this parameter is not yet implemented in groovy? Or am I using the working_directory parameter wrongly?

In any case, is there a way to fix this?

edit retag close merge delete

Sort by » oldest newest most voted

The WORKING_DIRECTORY option does not work when you specify a directory as the first argument. Then that directory is implicitly used by nosetests as the cwd. If you want to specify a different cwd you need to specify the test files explicitly.

I have updated the docblock to mention this: https://github.com/ros/catkin/commit/...

more