Skip to content

Commit

Permalink
Installed RViz configs for visual tests (#487)
Browse files Browse the repository at this point in the history
* Installed RViz configs for visual tests
  • Loading branch information
ahcorde committed Jan 10, 2020
1 parent 7f7a481 commit fea85f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions rviz_visual_testing_framework/CMakeLists.txt
Expand Up @@ -109,6 +109,11 @@ install(
DESTINATION include
)

install(
DIRECTORY config
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
# TODO(wjwwood): replace this with ament_lint_auto() and/or add the copyright linter back
find_package(ament_cmake_cppcheck REQUIRED)
Expand Down
11 changes: 8 additions & 3 deletions rviz_visual_testing_framework/src/visual_test_fixture.cpp
Expand Up @@ -34,6 +34,7 @@
#include <vector>

#include "rviz_common/ros_integration/ros_client_abstraction.hpp"
#include "ament_index_cpp/get_package_share_directory.hpp"

void VisualTestFixture::SetUpTestCase()
{
Expand All @@ -51,13 +52,17 @@ void VisualTestFixture::SetUpTestCase()
visualizer_app_->setApp(qapp_);

visualizer_app_->init(argc, argv);

std::string package_share_directory = ament_index_cpp::get_package_share_directory(
"rviz_visual_testing_framework");
if (VisualTest::generateReferenceImages()) {
visualizer_app_->loadConfig(QDir::toNativeSeparators(
QString::fromStdString(std::string(_SRC_DIR_PATH) + "/visual_tests_default_config.rviz")));
QString::fromStdString(package_share_directory +
"/config/visual_tests_default_config.rviz")));
} else {
visualizer_app_->loadConfig(QDir::toNativeSeparators(
QString::fromStdString(std::string(_SRC_DIR_PATH) +
"/visual_tests_test_image_config.rviz")));
QString::fromStdString(package_share_directory +
"/config/visual_tests_test_image_config.rviz")));
}
}

Expand Down

0 comments on commit fea85f8

Please sign in to comment.