Skip to content

Commit a258cb8

Browse files
authored
Refactor Rtde client test (#389)
The exhaustive rtde output recipe is now generated at build time, and the test will fail if the controller does not know all fields. The test will also fail if using the wrong ursim version.
1 parent d68f808 commit a258cb8

File tree

6 files changed

+345
-192
lines changed

6 files changed

+345
-192
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
ROBOT_MODEL: ${{matrix.env.ROBOT_MODEL}}
4141
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
4242
PROGRAM_FOLDER: ${{matrix.env.PROGRAM_FOLDER}}
43+
- name: install-pips
44+
run: pip install pandas lxml
4345
- name: configure
4446
run: mkdir build && cd build && cmake .. -DBUILDING_TESTS=1 -DINTEGRATION_TESTS=1 -DWITH_ASAN=ON
4547
env:
@@ -52,6 +54,8 @@ jobs:
5254
run: mkdir -p test_artifacts
5355
- name: test
5456
run: cd build && ctest --output-on-failure --output-junit junit.xml
57+
env:
58+
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
5559
- name: Upload test results to Codecov
5660
if: ${{ !cancelled() }}
5761
uses: codecov/test-results-action@v1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ install_manifest.txt
77
.idea
88
.directory
99
.vscode
10-
build/
10+
build/
11+
tests/resources/docs_rtde_output_recipe.txt

tests/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ option(INTEGRATION_TESTS "Build the integration tests that require a running rob
2121
if (INTEGRATION_TESTS)
2222
# Integration tests require a robot reachable at 192.168.56.101. Therefore, they have to be
2323
# activated separately.
24+
25+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
26+
27+
add_custom_target(generate_outputs ALL COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/resources/generate_rtde_outputs.py)
2428
add_executable(rtde_tests test_rtde_client.cpp)
29+
add_dependencies(rtde_tests generate_outputs)
2530
target_link_libraries(rtde_tests PRIVATE ur_client_library::urcl GTest::gtest_main)
2631
gtest_add_tests(TARGET rtde_tests
2732
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -111,6 +116,8 @@ target_link_libraries(primary_parser_tests PRIVATE ur_client_library::urcl GTest
111116
gtest_add_tests(TARGET primary_parser_tests
112117
)
113118

119+
120+
114121
add_executable(rtde_data_package_tests test_rtde_data_package.cpp)
115122
target_link_libraries(rtde_data_package_tests PRIVATE ur_client_library::urcl GTest::gtest_main)
116123
gtest_add_tests(TARGET rtde_data_package_tests

0 commit comments

Comments
 (0)