Refactor test build scripts

This commit is contained in:
Vinnie Falco
2017-07-28 18:59:14 -07:00
parent 61b2b63b57
commit 809e822789
400 changed files with 647 additions and 204 deletions

View File

@ -17,6 +17,7 @@ Version 91:
* Fix doc title
* Build stand-alone doc
* Update doc copyrights
* Refactor test build scripts
WebSocket:

View File

@ -190,6 +190,8 @@ file(GLOB_RECURSE EXTRAS_INCLUDES
${PROJECT_SOURCE_DIR}/extras/boost/beast/*.ipp
)
set (TEST_MAIN ${PROJECT_SOURCE_DIR}/extras/boost/beast/unit_test/main.cpp)
if (Beast_BUILD_BENCH)
add_subdirectory (bench)
endif()

View File

@ -7,22 +7,7 @@
# Official repository: https://github.com/boostorg/beast
#
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test/benchmarks "/")
GroupSources(test/http "/")
add_executable (benchmarks
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
Jamfile
../extras/boost/beast/unit_test/main.cpp
../test/http/message_fuzz.hpp
nodejs_parser.hpp
nodejs_parser.cpp
buffers.cpp
parser.cpp
utf8_checker.cpp
)
add_subdirectory (wstest)
add_subdirectory (buffers)
add_subdirectory (parser)
add_subdirectory (utf8_checker)
add_subdirectory (wsload)

View File

@ -6,17 +6,3 @@
#
# Official repository: https://github.com/boostorg/beast
#
local SOURCES =
buffers.cpp
utf8_checker.cpp # causes unnecessary dependencies
;
local BUILD_BENCH ; for local f in $(SOURCES) { BUILD_BENCH += [ exe $(f:B)-bench : $(f) $(TEST_MAIN) ] ; }
alias build-bench : $(BUILD_BENCH) ;
exe parser-bench :
nodejs_parser.cpp
parser.cpp
$(TEST_MAIN)
;

View File

@ -0,0 +1,20 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(bench/buffers "/")
add_executable (bench-buffers
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
bench_buffers.cpp
)

13
bench/buffers/Jamfile Normal file
View File

@ -0,0 +1,13 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
exe bench-buffers :
$(TEST_MAIN)
bench_buffers.cpp
;

View File

@ -0,0 +1,24 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test/beast/http "/")
GroupSources(bench/parser "/")
add_executable (bench-parser
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp
nodejs_parser.hpp
nodejs_parser.cpp
bench_parser.cpp
)

14
bench/parser/Jamfile Normal file
View File

@ -0,0 +1,14 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
exe bench-parser :
$(TEST_MAIN)
nodejs_parser.cpp
bench_parser.cpp
;

View File

@ -8,7 +8,8 @@
//
#include "nodejs_parser.hpp"
#include "test/http/message_fuzz.hpp"
#include "test/beast/http/message_fuzz.hpp"
#include <boost/beast/http.hpp>
#include <boost/beast/core/consuming_buffers.hpp>

View File

@ -0,0 +1,20 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(bench/utf8_checker "/")
add_executable (bench-utf8-checker
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
bench_utf8_checker.cpp
)

View File

@ -0,0 +1,13 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
exe bench-utf8-checker :
$(TEST_MAIN)
bench_utf8_checker.cpp
;

View File

@ -10,12 +10,12 @@
GroupSources(include/boost/beast beast)
GroupSources(example/common common)
GroupSources(extras/boost/beast extras)
GroupSources(bench/wstest "/")
GroupSources(bench/wsload "/")
add_executable (wstest
add_executable (bench-wsload
${BOOST_BEAST_INCLUDES}
${COMMON_INCLUDES}
${EXTRAS_INCLUDES}
Jamfile
wstest.cpp
wsload.cpp
)

View File

@ -7,6 +7,6 @@
# Official repository: https://github.com/boostorg/beast
#
exe wstest :
wstest.cpp
exe wsload :
wsload.cpp
;

View File

@ -65,19 +65,19 @@ echo "using BOOST_ROOT: $BOOST_ROOT"
#################################### HELPERS ###################################
function run_tests_with_debugger {
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/fat-tests; do
"$LIB_DIR/scripts/run-with-debugger.sh" "$x"
done
}
function run_tests {
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/fat-tests; do
$x
done
}
function run_tests_with_valgrind {
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/fat-tests; do
if [[ $(basename $x) == "bench-tests" ]]; then
$x
else
@ -90,10 +90,11 @@ function run_tests_with_valgrind {
function build_bjam {
if [[ $VARIANT == "coverage" ]]; then
bjam libs/beast/test//build-fat toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
bjam libs/beast/test//fat-tests toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
else
bjam libs/beast/test//build-fat toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
bjam libs/beast/test//fat-tests toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
bjam libs/beast/bench toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
bjam libs/beast/example toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
fi
}

View File

@ -7,37 +7,12 @@
# Official repository: https://github.com/boostorg/beast
#
add_subdirectory (core)
add_subdirectory (http)
add_subdirectory (websocket)
add_subdirectory (zlib)
if ((NOT "${VARIANT}" STREQUAL "coverage") AND
(NOT "${VARIANT}" STREQUAL "ubasan"))
add_subdirectory (common)
add_subdirectory (server)
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test "/")
add_executable (lib-tests
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
Jamfile
../extras/boost/beast/unit_test/main.cpp
config.cpp
core.cpp
exemplars.cpp
http.cpp
version.cpp
websocket.cpp
zlib.cpp
)
if (MINGW)
set_target_properties(lib-tests PROPERTIES COMPILE_FLAGS "-Wa,-mbig-obj")
endif()
if (OPENSSL_FOUND)
link_libraries (${OPENSSL_LIBRARIES})
endif()
add_subdirectory (beast)
add_subdirectory (doc)
add_subdirectory (example)
alias fat-tests : ;

View File

@ -7,41 +7,16 @@
# Official repository: https://github.com/boostorg/beast
#
import os ;
compile config.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile core.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile exemplars.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile http.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile version.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile websocket.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
compile zlib.cpp : <variant>coverage:<build>no <variant>ubasan:<build>no ;
alias run-tests :
common//run-tests
core//run-tests
http//run-tests
server//run-tests
websocket//run-tests
zlib//run-tests
beast//run-tests
doc//run-tests
example//run-tests
;
alias run-fat :
common//run-fat
core//run-fat
http//run-fat
server//run-fat
websocket//run-fat
zlib//run-fat
alias fat-tests :
beast//fat-tests
doc//fat-tests
example//fat-tests
;
explicit run-fat ;
alias build-fat :
common//build-fat
core//build-fat
http//build-fat
server//build-fat
websocket//build-fat
zlib//build-fat
;
explicit build-fat ;
explicit fat-tests ;

30
test/beast/CMakeLists.txt Normal file
View File

@ -0,0 +1,30 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
GroupSources(include/boost/beast beast)
GroupSources(extras/boost/beast extras)
GroupSources(test/beast "/")
add_executable (tests-beast
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
config.cpp
core.cpp
http.cpp
version.cpp
websocket.cpp
zlib.cpp
)
add_subdirectory (core)
add_subdirectory (http)
add_subdirectory (websocket)
add_subdirectory (zlib)

30
test/beast/Jamfile Normal file
View File

@ -0,0 +1,30 @@
#
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/beast
#
alias run-tests :
[ compile config.cpp ]
[ compile core.cpp ]
[ compile http.cpp ]
[ compile version.cpp ]
[ compile websocket.cpp ]
[ compile zlib.cpp ]
core//run-tests
http//run-tests
websocket//run-tests
zlib//run-tests
;
alias fat-tests :
core//fat-tests
http//fat-tests
websocket//fat-tests
zlib//fat-tests
;
explicit fat-tests ;

View File

@ -7,17 +7,15 @@
# Official repository: https://github.com/boostorg/beast
#
GroupSources(example example)
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test/core "/")
GroupSources(test/beast/core "/")
add_executable (core-tests
add_executable (tests-beast-core
${BOOST_BEAST_INCLUDES}
${EXAMPLE_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
../../extras/boost/beast/unit_test/main.cpp
buffer_test.hpp
file_test.hpp
async_result.cpp
@ -28,8 +26,6 @@ add_executable (core-tests
buffers_adapter.cpp
clamp.cpp
consuming_buffers.cpp
doc_examples.cpp
doc_snippets.cpp
drain_buffer.cpp
error.cpp
file.cpp

View File

@ -16,8 +16,6 @@ local SOURCES =
buffers_adapter.cpp
clamp.cpp
consuming_buffers.cpp
doc_examples.cpp
doc_snippets.cpp
drain_buffer.cpp
error.cpp
file.cpp
@ -44,11 +42,15 @@ local SOURCES =
detail/varint.cpp
;
local RUN_TESTS ; for local f in $(SOURCES) { RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ; }
local RUN_TESTS ;
for local f in $(SOURCES)
{
RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ;
}
alias run-tests : $(RUN_TESTS) ;
unit-test run-fat : $(TEST_MAIN) $(SOURCES) ;
explicit run-fat ;
exe fat-tests : $(TEST_MAIN) $(SOURCES) ;
exe build-fat : $(TEST_MAIN) $(SOURCES) ;
explicit build-fat ;
explicit fat-tests ;

View File

@ -7,26 +7,22 @@
# Official repository: https://github.com/boostorg/beast
#
GroupSources(example example)
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test/http "/")
GroupSources(test/beast/http "/")
add_executable (http-tests
add_executable (tests-beast-http
${BOOST_BEAST_INCLUDES}
${EXAMPLE_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
message_fuzz.hpp
test_parser.hpp
../../extras/boost/beast/unit_test/main.cpp
basic_dynamic_body.cpp
basic_file_body.cpp
basic_parser.cpp
buffer_body.cpp
chunk_encode.cpp
doc_examples.cpp
doc_snippets.cpp
dynamic_body.cpp
empty_body.cpp
error.cpp

View File

@ -13,8 +13,6 @@ local SOURCES =
basic_parser.cpp
buffer_body.cpp
chunk_encode.cpp
doc_examples.cpp
doc_snippets.cpp
dynamic_body.cpp
error.cpp
field.cpp
@ -34,11 +32,15 @@ local SOURCES =
write.cpp
;
local RUN_TESTS ; for local f in $(SOURCES) { RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ; }
local RUN_TESTS ;
for local f in $(SOURCES)
{
RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ;
}
alias run-tests : $(RUN_TESTS) ;
unit-test run-fat : $(TEST_MAIN) $(SOURCES) ;
explicit run-fat ;
exe fat-tests : $(TEST_MAIN) $(SOURCES) ;
exe build-fat : $(TEST_MAIN) $(SOURCES) ;
explicit build-fat ;
explicit fat-tests ;

View File

@ -9,17 +9,15 @@
GroupSources(extras/boost/beast extras)
GroupSources(include/boost/beast beast)
GroupSources(test/beast/websocket "/")
GroupSources(test/websocket "/")
add_executable (websocket-tests
add_executable (tests-beast-websocket
${BOOST_BEAST_INCLUDES}
${EXTRAS_INCLUDES}
${TEST_MAIN}
Jamfile
../../extras/boost/beast/unit_test/main.cpp
websocket_async_echo_server.hpp
websocket_sync_echo_server.hpp
doc_snippets.cpp
error.cpp
option.cpp
rfc6455.cpp
@ -29,9 +27,3 @@ add_executable (websocket-tests
mask.cpp
utf8_checker.cpp
)
if (OPENSSL_FOUND)
target_link_libraries(websocket-tests
${OPENSSL_LIBRARIES}
)
endif()

View File

@ -8,7 +8,6 @@
#
local SOURCES =
doc_snippets.cpp
error.cpp
option.cpp
rfc6455.cpp
@ -19,11 +18,15 @@ local SOURCES =
utf8_checker.cpp
;
local RUN_TESTS ; for local f in $(SOURCES) { RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ; }
local RUN_TESTS ;
for local f in $(SOURCES)
{
RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ;
}
alias run-tests : $(RUN_TESTS) ;
unit-test run-fat : $(TEST_MAIN) $(SOURCES) ;
explicit run-fat ;
exe fat-tests : $(TEST_MAIN) $(SOURCES) ;
exe build-fat : $(TEST_MAIN) $(SOURCES) ;
explicit build-fat ;
explicit fat-tests ;

Some files were not shown because too many files have changed in this diff Show More