File tree Expand file tree Collapse file tree 16 files changed +251
-40
lines changed Expand file tree Collapse file tree 16 files changed +251
-40
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ script:
81
81
- source /opt/ros/$ROS_DISTRO/setup.bash
82
82
- cd ~/catkin_ws
83
83
- catkin clean --all
84
- - catkin build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
84
+ - catkin config --blacklist ct_doc
85
+ - catkin build -DBUILD_TESTS=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"
85
86
# Run the tests, ensuring the path is set correctly.
86
87
# we do not want to run the kindr tests
87
88
- catkin config --blacklist kindr
Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ if(DOXYGEN_FOUND)
15
15
COMMAND ${CMAKE_COMMAND} -E echo_append "API Documentation built in ${CMAKE_CURRENT_SOURCE_DIR} "
16
16
VERBATIM )
17
17
18
+ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /html DESTINATION share/ct_core/doc )
18
19
endif ()
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ macro(package_add_test TESTNAME)
5
5
target_link_libraries (${TESTNAME} gtest gtest_main ct_core )
6
6
add_test (NAME ${TESTNAME} COMMAND ${TESTNAME} )
7
7
set_target_properties (${TESTNAME} PROPERTIES FOLDER test )
8
+ list (APPEND UNIT_TEST_TARGETS ${TESTNAME} )
8
9
endmacro ()
9
10
10
11
@@ -30,3 +31,12 @@ if(USE_PRESPEC)
30
31
package_add_test (IntegrationTestPrespec integration/IntegrationTestPrespec.cpp )
31
32
package_add_test (IntegratorComparisonPrespec integration/IntegratorComparisonPrespec.cpp )
32
33
endif (USE_PRESPEC )
34
+
35
+
36
+ # Run all unit tests post-build.
37
+ add_custom_target (run_tests ALL DEPENDS ${UNIT_TEST_TARGETS} )
38
+ add_custom_command (TARGET run_tests
39
+ COMMENT "Running tests"
40
+ POST_BUILD COMMAND ${PROJECT_SOURCE_DIR} /test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
41
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
42
+ )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ from __future__ import print_function
4
+
5
+ import os
6
+ import sys
7
+ import subprocess
8
+
9
+ def main (argv = sys .argv [1 :]):
10
+ working_dir = argv [0 ]
11
+ tests = argv [1 :]
12
+ print ("Working directory: {}" .format (working_dir ))
13
+ print ("Running tests: " , tests )
14
+
15
+ test_dir = working_dir + "/test_results"
16
+ if not os .path .exists (test_dir ):
17
+ os .makedirs (test_dir )
18
+
19
+ for the_file in os .listdir (test_dir ):
20
+ file_path = os .path .join (test_dir , the_file )
21
+ try :
22
+ if os .path .isfile (file_path ):
23
+ os .unlink (file_path )
24
+ except Exception , e :
25
+ print (e )
26
+
27
+ commands = []
28
+
29
+ for cmd in tests :
30
+ test_cmd = "./" + cmd + " --gtest_output=xml:" + working_dir + "/test_results/"
31
+ print ("Running: " , test_cmd )
32
+ rc = subprocess .call (test_cmd , cwd = working_dir , shell = True )
33
+
34
+ commands .insert (0 , test_cmd )
35
+
36
+ print ("Ran the following commands: " )
37
+ for cmd in commands :
38
+ print ("-- " , cmd )
39
+
40
+ if __name__ == '__main__' :
41
+ sys .exit (main ())
Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 2.6 )
1
+ cmake_minimum_required (VERSION 3.3 )
2
2
3
- project (ct_doc )
3
+ project (ct_doc VERSION 3.0.0 )
4
4
5
- find_package ( catkin REQUIRED )
5
+ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} " ${CMAKE_SOURCE_DIR} /cmake" )
6
6
7
- catkin_package (
8
- CATKIN_DEPENDS ct_core ct_optcon ct_rbd ct_models
9
- )
7
+
8
+ ## find and include required dependencies
9
+ find_package (ct_core REQUIRED )
10
+ find_package (ct_optcon REQUIRED )
11
+ find_package (ct_rbd REQUIRED )
12
+ find_package (ct_models REQUIRED )
10
13
11
14
find_package (Doxygen )
12
15
if (DOXYGEN_FOUND )
@@ -23,16 +26,11 @@ if(DOXYGEN_FOUND)
23
26
COMMAND ${CMAKE_COMMAND} -E echo_append "API Documentation built in ${CMAKE_CURRENT_SOURCE_DIR} /doc"
24
27
# COMMAND sensible-browser ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/index.html
25
28
VERBATIM )
29
+
30
+ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /doc/html DESTINATION share/ct_doc/doc )
26
31
endif ()
27
32
28
33
29
34
add_custom_target (clang-format
30
35
COMMAND ${CMAKE_COMMAND} -E echo_append ""
31
- VERBATIM )
32
-
33
- add_custom_target (clang-tidy
34
- COMMAND ${CMAKE_COMMAND} -E echo_append ""
35
- VERBATIM )
36
-
37
-
38
-
36
+ VERBATIM )
Original file line number Diff line number Diff line change 1
- <package >
1
+ <package format = " 2 " >
2
2
<name >ct_doc</name >
3
- <version >0.3 .0</version >
3
+ <version >3.0 .0</version >
4
4
<description >
5
- ADRL control toolbox - Documentation
5
+ Control toolbox - Documentation
6
6
</description >
7
-
8
- <maintainer email =" neunertm@gmail.com" >Michael Neunert</maintainer >
9
- <maintainer email =" mgiftthaler@ethz.ch" >Markus Giftthaler</maintainer >
10
-
7
+
8
+ <maintainer email =" markusgft@gmail.com" >Markus Giftthaler</maintainer >
9
+
11
10
<license >BSD-2</license >
12
-
13
- <buildtool_depend >catkin</buildtool_depend >
14
-
15
- <build_depend >ct_core</build_depend >
16
- <build_depend >ct_optcon</build_depend >
17
- <build_depend >ct_rbd</build_depend >
18
- <build_depend >ct_models</build_depend >
19
-
20
- <run_depend >ct_core</run_depend >
21
- <run_depend >ct_optcon</run_depend >
22
- <run_depend >ct_rbd</run_depend >
23
- <run_depend >ct_models</run_depend >
24
-
11
+
12
+ <buildtool_depend >cmake</buildtool_depend >
13
+
14
+ <depend >ct_core</depend >
15
+ <depend >ct_optcon</depend >
16
+ <depend >ct_rbd</depend >
17
+ <depend >ct_models</depend >
18
+
19
+ <exec_depend >catkin</exec_depend > <!-- ROS compatibility-->
20
+
21
+ <export > <!-- Specify that this is not a ROS package-->
22
+ <build_type >cmake</build_type >
23
+ </export >
24
+
25
25
</package >
Original file line number Diff line number Diff line change @@ -11,4 +11,6 @@ if(DOXYGEN_FOUND)
11
11
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
12
12
COMMAND ${CMAKE_COMMAND} -E echo_append "API Documentation built in ${CMAKE_CURRENT_SOURCE_DIR} "
13
13
VERBATIM )
14
+
15
+ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /html DESTINATION share/ct_models/doc )
14
16
endif ()
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ macro(package_add_test TESTNAME)
2
2
add_executable (${TESTNAME} ${ARGN} )
3
3
add_test (NAME ${TESTNAME} COMMAND ${TESTNAME} )
4
4
set_target_properties (${TESTNAME} PROPERTIES FOLDER test )
5
+ list (APPEND UNIT_TEST_TARGETS ${TESTNAME} )
5
6
endmacro ()
6
7
7
8
@@ -19,4 +20,13 @@ target_link_libraries(ikfast_test_irb gtest gtest_main irb4600_ik ct_rbd)
19
20
20
21
package_add_test (ikfast_test_hya IKFast/IKFastTestHyA.cpp )
21
22
target_include_directories (ikfast_test_hya PUBLIC ${ct_models_target_include_dirs} )
22
- target_link_libraries (ikfast_test_hya gtest gtest_main hya_ik ct_rbd )
23
+ target_link_libraries (ikfast_test_hya gtest gtest_main hya_ik ct_rbd )
24
+
25
+
26
+ # Run all unit tests post-build.
27
+ add_custom_target (run_tests ALL DEPENDS ${UNIT_TEST_TARGETS} )
28
+ add_custom_command (TARGET run_tests
29
+ COMMENT "Running tests"
30
+ POST_BUILD COMMAND ${PROJECT_SOURCE_DIR} /test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
31
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
32
+ )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ from __future__ import print_function
4
+
5
+ import os
6
+ import sys
7
+ import subprocess
8
+
9
+ def main (argv = sys .argv [1 :]):
10
+ working_dir = argv [0 ]
11
+ tests = argv [1 :]
12
+ print ("Working directory: {}" .format (working_dir ))
13
+ print ("Running tests: " , tests )
14
+
15
+ test_dir = working_dir + "/test_results"
16
+ if not os .path .exists (test_dir ):
17
+ os .makedirs (test_dir )
18
+
19
+ for the_file in os .listdir (test_dir ):
20
+ file_path = os .path .join (test_dir , the_file )
21
+ try :
22
+ if os .path .isfile (file_path ):
23
+ os .unlink (file_path )
24
+ except Exception , e :
25
+ print (e )
26
+
27
+ commands = []
28
+
29
+ for cmd in tests :
30
+ test_cmd = "./" + cmd + " --gtest_output=xml:" + working_dir + "/test_results/"
31
+ print ("Running: " , test_cmd )
32
+ rc = subprocess .call (test_cmd , cwd = working_dir , shell = True )
33
+
34
+ commands .insert (0 , test_cmd )
35
+
36
+ print ("Ran the following commands: " )
37
+ for cmd in commands :
38
+ print ("-- " , cmd )
39
+
40
+ if __name__ == '__main__' :
41
+ sys .exit (main ())
You can’t perform that action at this time.
0 commit comments