Skip to content

Commit

Permalink
Register tests in CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Nov 23, 2024
1 parent bb54264 commit 9427c7b
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
# Official repository: https://github.com/boostorg/beast
#

if(BOOST_BEAST_IS_ROOT)
set(EXCLUDE_TESTS_FROM_ALL)
else()
set(EXCLUDE_TESTS_FROM_ALL EXCLUDE_FROM_ALL)
endif()

if(NOT TARGET tests)
add_custom_target(tests ${EXCLUDE_TESTS_FROM_ALL})
set_property(TARGET tests PROPERTY FOLDER Dependencies)
endif()

find_package(OpenSSL)

# lib-asio
Expand Down
3 changes: 3 additions & 0 deletions test/beast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ target_link_libraries(tests-beast

set_target_properties(tests-beast
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast COMMAND tests-beast)
add_dependencies(tests tests-beast)
3 changes: 3 additions & 0 deletions test/beast/_experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ target_link_libraries(tests-beast-_experimental

set_target_properties(tests-beast-_experimental
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-_experimental COMMAND tests-beast-_experimental)
add_dependencies(tests tests-beast-_experimental)
3 changes: 3 additions & 0 deletions test/beast/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ target_link_libraries(tests-beast-core

set_target_properties(tests-beast-core
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-core COMMAND tests-beast-core)
add_dependencies(tests tests-beast-core)
3 changes: 3 additions & 0 deletions test/beast/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ target_link_libraries(tests-beast-http

set_target_properties(tests-beast-http
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-http COMMAND tests-beast-http)
add_dependencies(tests tests-beast-http)
3 changes: 3 additions & 0 deletions test/beast/ssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ target_link_libraries(tests-beast-ssl

set_target_properties(tests-beast-ssl
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-ssl COMMAND tests-beast-ssl)
add_dependencies(tests tests-beast-ssl)
3 changes: 3 additions & 0 deletions test/beast/websocket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ target_link_libraries(tests-beast-websocket

set_target_properties(tests-beast-websocket
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-websocket COMMAND tests-beast-websocket)
add_dependencies(tests tests-beast-websocket)
3 changes: 3 additions & 0 deletions test/beast/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ target_link_libraries(tests-beast-zlib

set_target_properties(tests-beast-zlib
PROPERTIES FOLDER "tests")

add_test(NAME tests-beast-zlib COMMAND tests-beast-zlib)
add_dependencies(tests tests-beast-zlib)
3 changes: 3 additions & 0 deletions test/doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ target_link_libraries(tests-doc

set_target_properties(tests-doc
PROPERTIES FOLDER "tests")

add_test(NAME tests-doc COMMAND tests-doc)
add_dependencies(tests tests-doc)
3 changes: 3 additions & 0 deletions test/example/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ target_link_libraries(tests-example-common

set_target_properties(tests-example-common
PROPERTIES FOLDER "tests")

add_test(NAME tests-example-common COMMAND tests-example-common)
add_dependencies(tests tests-example-common)
6 changes: 6 additions & 0 deletions test/fuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ function(add_boost_beast_fuzzer NAME)
add_dependencies(boost_beast_fuzz_all fuzz_${NAME})
set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "UBSAN_OPTIONS=halt_on_error=false")
set_target_properties(fuzz_${NAME} PROPERTIES FOLDER "fuzzing")
if (BOOST_BEAST_FUZZER_ADD_TO_CTEST)
add_test(
NAME test_fuzz_${NAME}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target fuzz_${NAME})
add_dependencies(tests test_fuzz_${NAME})
endif()
endfunction()

# Register all fuzzers
Expand Down

0 comments on commit 9427c7b

Please sign in to comment.