eclass/ros-catkin.eclass: Regenerate devel environment before running tests. PYTHONPA...
authorAlexis Ballier <aballier@gentoo.org>
Thu, 23 Feb 2017 09:15:38 +0000 (10:15 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Thu, 23 Feb 2017 09:15:55 +0000 (10:15 +0100)
eclass/ros-catkin.eclass

index 93086aa123a762794f79150a82d96aef82be71a5..a90a8da03a35ffa6239c8d843d40ee5dde1cd8cd 100644 (file)
@@ -218,6 +218,11 @@ ros-catkin_src_compile() {
 # Decorator around cmake-utils_src_test to ensure tests are built before running them.
 ros-catkin_src_test_internal() {
        cd "${BUILD_DIR}" || die
+       # Regenerate env for tests, PYTHONPATH is not set properly otherwise...
+       if [ -f catkin_generated/generate_cached_setup.py ] ; then
+               einfo "Regenerating setup_cached.sh for tests"
+               ${PYTHON:-python} catkin_generated/generate_cached_setup.py || die
+       fi
        # Using cmake-utils_src_make with nonfatal does not work and breaks e.g.
        # dev-ros/rviz.
        if nonfatal emake tests -n &> /dev/null ; then