diff --git a/.travis.yml b/.travis.yml index 59d3685..347b045 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,10 @@ before_script: # Use this to prepare your build for testing e.g. copy database c script: # All commands must exit with code 0 on success. Anything else is considered failure. - find . \! -path "*/.*" -type f | xargs egrep -i "(hoge|fuga)" ; if [ $? == 0 ]; then exit 1; fi - catkin_make - # - catkin_make test + - catkin_make test - catkin_make install + - source install/setup.bash + - catkin_make test + diff --git a/rtctree/Makefile.rtctree b/rtctree/Makefile.rtctree index 5f33bec..c50a2e3 100644 --- a/rtctree/Makefile.rtctree +++ b/rtctree/Makefile.rtctree @@ -1,4 +1,6 @@ INSTALL_DIR = ${CURDIR} +INSTALL_SCRIPTS_DIR = ${CURDIR} +INSTALL_DATA_DIR = ${CURDIR} SOURCE_DIR = build/rtctree-3.0.0 TARBALL = build/rtctree-3.0.0.zip TARBALL_URL = https://github.com/gbiggs/rtctree/archive/3.0.0.zip @@ -10,7 +12,7 @@ UNPACK_CMD = unzip include ${MK_DIR}/download_unpack_build.mk installed: $(SOURCE_DIR)/unpacked - (cd $(SOURCE_DIR) && python setup.py build && python setup.py install --prefix $(INSTALL_DIR) --record installed_files.txt) + (cd $(SOURCE_DIR) && python setup.py build && python setup.py install --prefix $(INSTALL_DIR) --install-scripts $(INSTALL_SCRIPTS_DIR) --install-data $(INSTALL_DATA_DIR) --install-layout=deb --record installed_files.txt) touch installed clean: diff --git a/rtctree/catkin.cmake b/rtctree/catkin.cmake index 68b9d50..ff2e7c5 100644 --- a/rtctree/catkin.cmake +++ b/rtctree/catkin.cmake @@ -7,44 +7,28 @@ project(rtctree) find_package(catkin REQUIRED mk) # Build rtctree -execute_process(COMMAND cmake -E chdir ${PROJECT_SOURCE_DIR} make -f Makefile.rtctree MK_DIR=${mk_PREFIX}/share/mk installed - RESULT_VARIABLE _make_failed) -if (_make_failed) - message(FATAL_ERROR "Build of failed") -endif(_make_failed) - -## System dependencies are found with CMake's conventions -# find_package(Boost REQUIRED COMPONENTS system) - +# /lib//bin +# /lib/python2.7/dist-packages +# //share +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/installed) + execute_process( + COMMAND cmake -E chdir ${CMAKE_CURRENT_BINARY_DIR} + make -f ${PROJECT_SOURCE_DIR}/Makefile.rtctree installed + INSTALL_DIR=${CATKIN_DEVEL_PREFIX} + INSTALL_SCRIPTS_DIR=${CATKIN_DEVEL_PREFIX}/lib/${PROJECT_NAME} + INSTALL_DATA_DIR=${PROJECT_SOURCE_DIR} + MK_DIR=${mk_PREFIX}/share/mk + MD5SUM_FILE=${PROJECT_SOURCE_DIR}/rtctree-3.0.0.zip.md5sum + RESULT_VARIABLE _make_failed) + if (_make_failed) + message(FATAL_ERROR "Build of rtctree failed") + endif(_make_failed) +endif() ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html -catkin_python_setup() - -####################################### -## Declare ROS messages and services ## -####################################### - -## Generate messages in the 'msg' folder -# add_message_files( -# FILES -# Message1.msg -# Message2.msg -# ) - -## Generate services in the 'srv' folder -# add_service_files( -# FILES -# Service1.srv -# Service2.srv -# ) - -## Generate added messages and services with any dependencies listed here -# generate_messages( -# DEPENDENCIES -# std_msgs # Or other packages containing msgs -# ) +#catkin_python_setup() ################################### ## catkin specific configuration ## @@ -62,34 +46,6 @@ catkin_package( # DEPENDS system_lib ) -########### -## Build ## -########### - -## Specify additional locations of header files -## Your package locations should be listed before other locations -# include_directories(include) -include_directories( - ${catkin_INCLUDE_DIRS} -) - -## Declare a cpp library -# add_library(openrtm_tools -# src/${PROJECT_NAME}/openrtm_tools.cpp -# ) - -## Declare a cpp executable -# add_executable(openrtm_tools_node src/openrtm_tools_node.cpp) - -## Add cmake target dependencies of the executable/library -## as an example, message headers may need to be generated before nodes -# add_dependencies(openrtm_tools_node openrtm_tools_generate_messages_cpp) - -## Specify libraries to link a library or executable target against -# target_link_libraries(openrtm_tools_node -# ${catkin_LIBRARIES} -# ) - ############# ## Install ## ############# @@ -97,33 +53,9 @@ include_directories( # all install targets should use catkin DESTINATION variables # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS openrtm_tools openrtm_tools_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) +install( + DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}/ + DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}) ############# ## Testing ## diff --git a/rtctree/manifest.xml b/rtctree/manifest.xml index 7e23f1f..9c693e8 100644 --- a/rtctree/manifest.xml +++ b/rtctree/manifest.xml @@ -18,7 +18,7 @@ - + diff --git a/rtshell/Makefile.rtshell b/rtshell/Makefile.rtshell index dc2e0ef..0657cbc 100644 --- a/rtshell/Makefile.rtshell +++ b/rtshell/Makefile.rtshell @@ -1,4 +1,6 @@ INSTALL_DIR = ${CURDIR} +INSTALL_SCRIPTS_DIR = ${CURDIR} +INSTALL_DATA_DIR = ${CURDIR} SOURCE_DIR = build/rtshell-3.0.0 TARBALL = build/rtshell-3.0.0.zip TARBALL_URL = https://github.com/gbiggs/rtshell/archive/3.0.0.zip @@ -10,7 +12,7 @@ UNPACK_CMD = unzip include $(MK_DIR)/download_unpack_build.mk installed: $(SOURCE_DIR)/unpacked - (cd $(SOURCE_DIR) && yes | python setup.py build && yes | python setup.py install --prefix $(INSTALL_DIR) --record installed_files.txt) + (cd $(SOURCE_DIR) && yes | python setup.py build && yes | python setup.py install --prefix $(INSTALL_DIR) --install-scripts $(INSTALL_SCRIPTS_DIR) --install-data $(INSTALL_DATA_DIR) --install-layout=deb --record installed_files.txt) touch installed clean: diff --git a/rtshell/catkin.cmake b/rtshell/catkin.cmake index 3c7ae8c..a6c744e 100644 --- a/rtshell/catkin.cmake +++ b/rtshell/catkin.cmake @@ -7,44 +7,28 @@ project(rtshell) find_package(catkin REQUIRED mk rostest) # Build rtshell -execute_process(COMMAND cmake -E chdir ${PROJECT_SOURCE_DIR} make -f Makefile.rtshell MK_DIR=${mk_PREFIX}/share/mk installed - RESULT_VARIABLE _make_failed) -if (_make_failed) - message(FATAL_ERROR "Build of failed") -endif(_make_failed) - -## System dependencies are found with CMake's conventions -# find_package(Boost REQUIRED COMPONENTS system) - +# /lib//bin +# /lib/python2.7/dist-packages +# //share +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/installed) + execute_process( + COMMAND cmake -E chdir ${CMAKE_CURRENT_BINARY_DIR} + make -f ${PROJECT_SOURCE_DIR}/Makefile.rtshell installed + INSTALL_DIR=${CATKIN_DEVEL_PREFIX} + INSTALL_SCRIPTS_DIR=${CATKIN_DEVEL_PREFIX}/lib/${PROJECT_NAME} + INSTALL_DATA_DIR=${PROJECT_SOURCE_DIR} + MK_DIR=${mk_PREFIX}/share/mk + MD5SUM_FILE=${PROJECT_SOURCE_DIR}/rtshell-3.0.0.zip.md5sum + RESULT_VARIABLE _make_failed) + if (_make_failed) + message(FATAL_ERROR "Build of rtshell failed") + endif(_make_failed) +endif() ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html -catkin_python_setup() - -####################################### -## Declare ROS messages and services ## -####################################### - -## Generate messages in the 'msg' folder -# add_message_files( -# FILES -# Message1.msg -# Message2.msg -# ) - -## Generate services in the 'srv' folder -# add_service_files( -# FILES -# Service1.srv -# Service2.srv -# ) - -## Generate added messages and services with any dependencies listed here -# generate_messages( -# DEPENDENCIES -# std_msgs # Or other packages containing msgs -# ) +#catkin_python_setup() ################################### ## catkin specific configuration ## @@ -62,34 +46,6 @@ catkin_package( # DEPENDS system_lib ) -########### -## Build ## -########### - -## Specify additional locations of header files -## Your package locations should be listed before other locations -# include_directories(include) -include_directories( - ${catkin_INCLUDE_DIRS} -) - -## Declare a cpp library -# add_library(openrtm_tools -# src/${PROJECT_NAME}/openrtm_tools.cpp -# ) - -## Declare a cpp executable -# add_executable(openrtm_tools_node src/openrtm_tools_node.cpp) - -## Add cmake target dependencies of the executable/library -## as an example, message headers may need to be generated before nodes -# add_dependencies(openrtm_tools_node openrtm_tools_generate_messages_cpp) - -## Specify libraries to link a library or executable target against -# target_link_libraries(openrtm_tools_node -# ${catkin_LIBRARIES} -# ) - ############# ## Install ## ############# @@ -97,36 +53,26 @@ include_directories( # all install targets should use catkin DESTINATION variables # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS openrtm_tools openrtm_tools_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -install(DIRECTORY share +install( + DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}/ + DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}) +install( + DIRECTORY ${CATKIN_DEVEL_PREFIX}/lib/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + USE_SOURCE_PERMISSIONS) +install( + DIRECTORY test share DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} - PATTERN ".svn" EXCLUDE -) + USE_SOURCE_PERMISSIONS) +install( + DIRECTORY test share + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + USE_SOURCE_PERMISSIONS) + install(CODE "execute_process(COMMAND echo \"sed -i s@${PROJECT_SOURCE_DIR}@${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}@g \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/share/rtshell/shell_support\") - execute_process(COMMAND sed -i s@${PROJECT_SOURCE_DIR}@${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}@g \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/share/${PROJECT_NAME}/shell_support) -") - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) + execute_process(COMMAND sed -i s@${PROJECT_SOURCE_DIR}@${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}@g \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/share/${PROJECT_NAME}/shell_support) + ") ############# ## Testing ## @@ -141,6 +87,5 @@ install(CODE ## Add folders to be run by python nosetests # catkin_add_nosetests(test) -install(DIRECTORY test DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS) -add_rostest(test/run_rtshell.test) +add_rostest(test/test_rtshell.test) diff --git a/rtshell/manifest.xml b/rtshell/manifest.xml index 3b9ea84..a297dda 100644 --- a/rtshell/manifest.xml +++ b/rtshell/manifest.xml @@ -22,7 +22,7 @@ - + diff --git a/rtshell/test/run_rtshell.test b/rtshell/test/run_rtshell.test deleted file mode 100644 index ee0e60b..0000000 --- a/rtshell/test/run_rtshell.test +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/rtshell/test/run_rtshell_test.py b/rtshell/test/run_rtshell_test.py deleted file mode 100644 index 3142ea2..0000000 --- a/rtshell/test/run_rtshell_test.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python - -PKG = 'rtshell' -NAME = 'run_rtshell_test' - -import os -import sys -import time -import unittest -import yaml - -import rostest - -from subprocess import Popen, PIPE, check_call, call - -class TestRtshellOnline(unittest.TestCase): - - def setUp(self): - self.vals = set() - self.msgs = {} - - def test_roslaunch(self): - # network is initialized - cmd = 'rtls' - - # check if rtshell runs - check_call([cmd]) - -if __name__ == '__main__': - rostest.run(PKG, NAME, TestRtshellOnline, sys.argv) diff --git a/rtshell/test/test_rtshell.py b/rtshell/test/test_rtshell.py new file mode 100755 index 0000000..4e1c877 --- /dev/null +++ b/rtshell/test/test_rtshell.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +PKG = 'rtshell' +NAME = 'test_rtshell' + +import os +import sys +import time +import unittest +import yaml + +import rostest + +from subprocess import Popen, PIPE, check_output, check_call, call + +class TestRtshellOnline(unittest.TestCase): + + def setUp(self): + pass + + def test_rtls(self): + # check if rtshell runs + check_call(['rosrun','rtshell','rtls']) + + def test_share(self): + # check if rtshell runs + self.assertTrue(os.path.exists(os.path.join(check_output(['rospack','find','rtshell']).rstrip(), "share/rtshell/shell_support"))) + + def test_shell_support(self): + # check if rtshell runs + fname=os.path.join(check_output(['rospack','find','rtshell']).rstrip(), "share/rtshell/shell_support") + self.assertEqual(check_call("bash "+fname, shell=True),0) + +#unittest.main() +if __name__ == '__main__': + rostest.run(PKG, NAME, TestRtshellOnline, sys.argv) diff --git a/rtshell/test/test_rtshell.test b/rtshell/test/test_rtshell.test new file mode 100644 index 0000000..33f7c89 --- /dev/null +++ b/rtshell/test/test_rtshell.test @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/rtsprofile/Makefile.rtsprofile b/rtsprofile/Makefile.rtsprofile index 9120ac1..248639b 100644 --- a/rtsprofile/Makefile.rtsprofile +++ b/rtsprofile/Makefile.rtsprofile @@ -1,4 +1,6 @@ INSTALL_DIR = ${CURDIR} +INSTALL_SCRIPTS_DIR = ${CURDIR} +INSTALL_DATA_DIR = ${CURDIR} SOURCE_DIR = build/rtsprofile-2.0.0 TARBALL = build/rtsprofile-2.0.0.zip TARBALL_URL = https://github.com/gbiggs/rtsprofile/archive/2.0.0.zip @@ -10,7 +12,7 @@ UNPACK_CMD = unzip include ${MK_DIR}/download_unpack_build.mk installed: $(SOURCE_DIR)/unpacked - (cd $(SOURCE_DIR) && python setup.py build && python setup.py install --prefix $(INSTALL_DIR) --record installed_files.txt) + (cd $(SOURCE_DIR) && python setup.py build && python setup.py install --prefix $(INSTALL_DIR) --install-scripts $(INSTALL_SCRIPTS_DIR) --install-data $(INSTALL_DATA_DIR) --install-layout=deb --record installed_files.txt) touch installed clean: diff --git a/rtsprofile/catkin.cmake b/rtsprofile/catkin.cmake index e97ec2d..929f9e7 100644 --- a/rtsprofile/catkin.cmake +++ b/rtsprofile/catkin.cmake @@ -7,44 +7,28 @@ project(rtsprofile) find_package(catkin REQUIRED mk) # Build rtsprofile -execute_process(COMMAND cmake -E chdir ${PROJECT_SOURCE_DIR} make -f Makefile.rtsprofile MK_DIR=${mk_PREFIX}/share/mk installed - RESULT_VARIABLE _make_failed) -if (_make_failed) - message(FATAL_ERROR "Build of failed") -endif(_make_failed) - -## System dependencies are found with CMake's conventions -# find_package(Boost REQUIRED COMPONENTS system) - +# /lib//bin +# /lib/python2.7/dist-packages +# //share +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/installed) + execute_process( + COMMAND cmake -E chdir ${CMAKE_CURRENT_BINARY_DIR} + make -f ${PROJECT_SOURCE_DIR}/Makefile.rtsprofile installed + INSTALL_DIR=${CATKIN_DEVEL_PREFIX} + INSTALL_SCRIPTS_DIR=${CATKIN_DEVEL_PREFIX}/lib/${PROJECT_NAME} + INSTALL_DATA_DIR=${PROJECT_SOURCE_DIR} + MK_DIR=${mk_PREFIX}/share/mk + MD5SUM_FILE=${PROJECT_SOURCE_DIR}/rtsprofile-2.0.0.zip.md5sum + RESULT_VARIABLE _make_failed) + if (_make_failed) + message(FATAL_ERROR "Build of rtsprofile failed") + endif(_make_failed) +endif() ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html -catkin_python_setup() - -####################################### -## Declare ROS messages and services ## -####################################### - -## Generate messages in the 'msg' folder -# add_message_files( -# FILES -# Message1.msg -# Message2.msg -# ) - -## Generate services in the 'srv' folder -# add_service_files( -# FILES -# Service1.srv -# Service2.srv -# ) - -## Generate added messages and services with any dependencies listed here -# generate_messages( -# DEPENDENCIES -# std_msgs # Or other packages containing msgs -# ) +#catkin_python_setup() ################################### ## catkin specific configuration ## @@ -62,34 +46,6 @@ catkin_package( # DEPENDS system_lib ) -########### -## Build ## -########### - -## Specify additional locations of header files -## Your package locations should be listed before other locations -# include_directories(include) -include_directories( - ${catkin_INCLUDE_DIRS} -) - -## Declare a cpp library -# add_library(openrtm_tools -# src/${PROJECT_NAME}/openrtm_tools.cpp -# ) - -## Declare a cpp executable -# add_executable(openrtm_tools_node src/openrtm_tools_node.cpp) - -## Add cmake target dependencies of the executable/library -## as an example, message headers may need to be generated before nodes -# add_dependencies(openrtm_tools_node openrtm_tools_generate_messages_cpp) - -## Specify libraries to link a library or executable target against -# target_link_libraries(openrtm_tools_node -# ${catkin_LIBRARIES} -# ) - ############# ## Install ## ############# @@ -97,33 +53,9 @@ include_directories( # all install targets should use catkin DESTINATION variables # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS openrtm_tools openrtm_tools_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) +install( + DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}/ + DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}) ############# ## Testing ## diff --git a/rtsprofile/manifest.xml b/rtsprofile/manifest.xml index c93ec39..78d2f16 100644 --- a/rtsprofile/manifest.xml +++ b/rtsprofile/manifest.xml @@ -14,7 +14,7 @@ https://github.com/gbiggs/rtsprofile - +