Skip to content

Commit

Permalink
build: tests are excluded for all target
Browse files Browse the repository at this point in the history
fix #841
  • Loading branch information
alandefreitas committed Aug 17, 2024
1 parent 604a117 commit cfdc2fb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 27 deletions.
24 changes: 1 addition & 23 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,28 +231,6 @@ elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then
cd "$BOOST_ROOT/libs/$SELF"
ci/travis/valgrind.sh

elif [ "$DRONE_JOB_BUILDTYPE" == "standalone" ]; then

echo '==================================> INSTALL'

# Installing cmake with apt-get, so not required here:
# pip install --user cmake

echo '==================================> SCRIPT'

export CXXFLAGS="-Wall -Wextra -Werror -std=c++17"
mkdir __build_17
cd __build_17
cmake -DBOOST_JSON_STANDALONE=1 ..
cmake --build .
ctest -V .
export CXXFLAGS="-Wall -Wextra -Werror -std=c++2a"
mkdir ../__build_2a
cd ../__build_2a
cmake -DBOOST_JSON_STANDALONE=1 ..
cmake --build .
ctest -V .

elif [ "$DRONE_JOB_BUILDTYPE" == "coverity" ]; then

echo '==================================> INSTALL'
Expand Down Expand Up @@ -329,7 +307,7 @@ elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-install" ]; then
cd "libs/$SELF"
mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build . --target install
cmake --build . --target tests
ctest --output-on-failure

# CMake subdir tests
Expand Down
2 changes: 1 addition & 1 deletion test/extra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set(TEST_FILES Jamfile test_suite.cpp)

# Test target
add_executable(boost_url_extra ${TEST_FILES} ${SUITE_FILES})
add_executable(boost_url_extra EXCLUDE_FROM_ALL ${TEST_FILES} ${SUITE_FILES})
target_include_directories(boost_url_extra PRIVATE . ../../extra)
target_link_libraries(boost_url_extra PRIVATE Boost::url)

Expand Down
2 changes: 1 addition & 1 deletion test/fuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ target_link_libraries(boost_url_fuzz PRIVATE -fsanitize=fuzzer,address,undefined
function(add_boost_url_fuzzer NAME)
# Fuzzer executable
set(SOURCE_FILES ${ARGN})
add_executable(fuzzer_${NAME} ${SOURCE_FILES})
add_executable(fuzzer_${NAME} EXCLUDE_FROM_ALL ${SOURCE_FILES})
target_link_libraries(fuzzer_${NAME} PRIVATE boost_url_fuzz)
target_compile_options(fuzzer_${NAME} PRIVATE -g -O2 -fsanitize=fuzzer,address,undefined -fno-sanitize-recover=undefined)
target_link_libraries(fuzzer_${NAME} PRIVATE -fsanitize=fuzzer,address,undefined)
Expand Down
2 changes: 1 addition & 1 deletion test/limits/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ boost_url_setup_properties(boost_url_small_limits)
target_compile_definitions(boost_url_small_limits PUBLIC BOOST_URL_MAX_SIZE=16 BOOST_URL_NO_LIB=1)

# Test target
add_executable(boost_url_limits limits.cpp Jamfile ${SUITE_FILES})
add_executable(boost_url_limits EXCLUDE_FROM_ALL limits.cpp Jamfile ${SUITE_FILES})
target_include_directories(boost_url_limits PRIVATE ../../include ../../extra ../../..)
target_link_libraries(boost_url_limits PRIVATE boost_url_small_limits)
if (DEFINED BOOST_URL_TEST_FLAGS AND NOT BOOST_URL_TEST_FLAGS STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ list(APPEND BOOST_URL_TESTS_FILES CMakeLists.txt Jamfile)
set(EXAMPLE_FILES ../../example/router/impl/matches.cpp ../../example/router/detail/impl/router.cpp)

# Test target
add_executable(boost_url_unit_tests ${BOOST_URL_TESTS_FILES} ${SUITE_FILES} ${EXAMPLE_FILES})
add_executable(boost_url_unit_tests EXCLUDE_FROM_ALL ${BOOST_URL_TESTS_FILES} ${SUITE_FILES} ${EXAMPLE_FILES})
target_include_directories(boost_url_unit_tests PRIVATE . ../../extra ../../example/router)
target_link_libraries(boost_url_unit_tests PUBLIC Boost::url)
foreach (BOOST_URL_UNIT_TEST_LIBRARY ${BOOST_URL_UNIT_TEST_LIBRARIES})
Expand Down

0 comments on commit cfdc2fb

Please sign in to comment.