Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SKIP_DEPRECATED functionality to ign-common #300

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ elseif(WIN32)
option(USE_EXTERNAL_TINYXML2 "Use a system-installed version of tinyxml2" OFF)
endif()

#--------------------------------------
# Option: Should we skip tests of deprecated functionality
option(SKIP_DEPRECATED_TESTS "Skip testing deprecated funcationality" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the description, I would have a question: is this skipping the build of the deprecated tests or is this skipping the run of the deprecated tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the description, I would have a question: is this skipping the build of the deprecated tests or is this skipping the run of the deprecated tests?

The idea is to skip both. This would primarily be for local development as building/running those tests isn't particularly valuable when you are iterating quickly.

# Option: Should we skip building deprecated functionality entirely
option(SKIP_DEPRECATED "Skip building deprecated functionality" OFF)

if(SKIP_DEPRECATED)
set(SKIP_DEPRECATED_TESTS ON)
endif()

#============================================================================
# Search for project-specific dependencies
Expand Down
22 changes: 21 additions & 1 deletion include/ignition/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
if(SKIP_DEPRECATED)
set(EXCLUDE_FILES
Plugin.hh
PluginInfo.hh
PluginLoader.hh
PluginMacros.hh
PluginPtr.hh
SpecializedPlugin.hh
SpecializedPluginPtr.hh
TemplateHelpers.hh
detail/Plugin.hh
detail/PluginLoader.hh
detail/PluginMacros.hh
detail/PluginPtr.hh
detail/SpecializedPlugin.hh
detail/TemplateHelpers.hh
)
else()
set(EXCLUDE_FILES)
endif()

ign_install_all_headers()
ign_install_all_headers(EXCLUDE_FILES ${EXCLUDE_FILES})
17 changes: 17 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
# "gtest_sources" variable
ign_get_libsources_and_unittests(sources gtest_sources)

if(SKIP_DEPRECATED)
list(REMOVE_ITEM sources
Plugin.cc
PluginLoader.cc
PluginUtils.hh
)
endif()

if(SKIP_DEPRECATED_TESTS)
list(REMOVE_ITEM gtest_sources
PluginLoader_TEST.cc
PluginUtils_TEST.cc
TemplateHelpers_TEST.cc
)
endif()


# Create the library target
ign_create_core_library(
SOURCES ${sources}
Expand Down
7 changes: 5 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a")
add_subdirectory(integration)
add_subdirectory(performance)
add_subdirectory(regression)
add_subdirectory(plugins)
add_subdirectory(static_assertions)

if(NOT SKIP_DEPRECATED)
add_subdirectory(plugins)
add_subdirectory(static_assertions)
endif()

configure_file(test_config.h.in ${PROJECT_BINARY_DIR}/test_config.h)
4 changes: 4 additions & 0 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ if (SKIP_av OR INTERNAL_SKIP_av)
list(REMOVE_ITEM tests video_encoder.cc)
endif()

if(SKIP_DEPRECATED_TESTS)
list(REMOVE_ITEM tests plugin.cc)
endif()

ign_build_tests(
TYPE INTEGRATION
SOURCES ${tests}
Expand Down
5 changes: 5 additions & 0 deletions test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "COVERAGE")
plugin_specialization.cc)
endif()

if(SKIP_DEPRECATED_TESTS)
list(REMOVE_ITEM tests
plugin_specialization.cc)
endif()

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(
Expand Down