forked from boostorg/beast
Refactor tests Jamfile
This commit is contained in:
@@ -5,6 +5,7 @@ Version 87:
|
||||
* variant fixes and tests
|
||||
* Update README, add CONTRIBUTING.md and CODE_OF_CONDUCT.md
|
||||
* Update doc links in README.md
|
||||
* Refactor tests Jamfile
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
16
Jamfile
16
Jamfile
@@ -13,6 +13,8 @@ import boost ;
|
||||
import modules ;
|
||||
import testing ;
|
||||
|
||||
#import ../config/checks/config : requires ;
|
||||
|
||||
boost.use-project ;
|
||||
|
||||
if [ os.name ] = SOLARIS
|
||||
@@ -64,14 +66,17 @@ variant ubasan
|
||||
<linkflags>"-fsanitize=address,undefined"
|
||||
;
|
||||
|
||||
#local REQ = [ requires cxx11_variadic_templates cxx11_template_aliases cxx11_decltype cxx11_hdr_type_traits cxx11_hdr_tuple ] ;
|
||||
|
||||
project beast
|
||||
: requirements
|
||||
#$(REQ)
|
||||
<implicit-dependency>/boost//headers
|
||||
<include>.
|
||||
<include>./extras
|
||||
#<use>/boost//headers
|
||||
<library>/boost/system//boost_system
|
||||
<library>/boost/coroutine//boost_coroutine
|
||||
<library>/boost/coroutine//boost_coroutine/<define>BOOST_COROUTINES_NO_DEPRECATION_WARNING=1
|
||||
<library>/boost/filesystem//boost_filesystem
|
||||
<library>/boost/program_options//boost_program_options
|
||||
<define>BOOST_ALL_NO_LIB=1
|
||||
@@ -84,20 +89,12 @@ project beast
|
||||
<define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1
|
||||
<define>BOOST_ASIO_DISABLE_BOOST_REGEX=1
|
||||
<toolset>gcc:<cxxflags>-std=c++11
|
||||
<toolset>gcc:<cxxflags>-Wno-unused-parameter
|
||||
<toolset>gcc:<cxxflags>-Wno-unused-variable # Temporary until we can figure out -isystem
|
||||
<toolset>clang:<cxxflags>-std=c++11
|
||||
<toolset>clang:<cxxflags>-Wno-unused-parameter
|
||||
<toolset>clang:<cxxflags>-Wno-unused-variable # Temporary until we can figure out -isystem
|
||||
<toolset>clang:<cxxflags>-Wrange-loop-analysis
|
||||
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS=1
|
||||
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS=1
|
||||
<toolset>msvc:<cxxflags>"/permissive- /bigobj"
|
||||
<toolset>msvc:<variant>release:<cxxflags>"/Ob2 /Oi /Ot"
|
||||
<os>LINUX:<define>_XOPEN_SOURCE=600
|
||||
<os>LINUX:<define>_GNU_SOURCE=1
|
||||
<os>SOLARIS:<define>_XOPEN_SOURCE=500
|
||||
<os>SOLARIS:<define>__EXTENSIONS__
|
||||
<os>SOLARIS:<library>socket
|
||||
<os>SOLARIS:<library>nsl
|
||||
<os>NT:<define>_WIN32_WINNT=0x0601
|
||||
@@ -107,5 +104,4 @@ project beast
|
||||
<os>NT,<toolset>gcc:<library>mswsock
|
||||
<os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
|
||||
: usage-requirements
|
||||
:
|
||||
;
|
||||
|
@@ -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/**/*-tests; do
|
||||
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
|
||||
"$LIB_DIR/scripts/run-with-debugger.sh" "$x"
|
||||
done
|
||||
}
|
||||
|
||||
function run_tests {
|
||||
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/*-tests; do
|
||||
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
|
||||
$x
|
||||
done
|
||||
}
|
||||
|
||||
function run_tests_with_valgrind {
|
||||
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/*-tests; do
|
||||
for x in $BOOST_ROOT/bin.v2/libs/beast/test/**/$VARIANT/**/build-fat; do
|
||||
if [[ $(basename $x) == "bench-tests" ]]; then
|
||||
$x
|
||||
else
|
||||
@@ -89,8 +89,13 @@ function run_tests_with_valgrind {
|
||||
}
|
||||
|
||||
function build_bjam {
|
||||
bjam libs/beast/test 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}
|
||||
if [[ $VARIANT == "coverage" ]]; then
|
||||
bjam libs/beast/test//build-fat 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/example toolset=$TOOLSET variant=$VARIANT address-model=$ADDRESS_MODEL -j${num_jobs}
|
||||
fi
|
||||
}
|
||||
|
||||
function build_cmake {
|
||||
@@ -151,13 +156,13 @@ if [[ $VARIANT == "coverage" ]]; then
|
||||
lcov --no-external -c -i -d "$BOOST_ROOT" -o baseline.info > /dev/null
|
||||
|
||||
# Perform test
|
||||
if [[ $MAIN_BRANCH == "1" && "$DO_VALGRIND" = true ]]; then
|
||||
run_tests_with_valgrind
|
||||
#run_autobahn_test_suite # skip slow autobahn tests
|
||||
else
|
||||
echo "skipping autobahn/valgrind tests for feature branch build"
|
||||
#if [[ $MAIN_BRANCH == "1" && "$DO_VALGRIND" = true ]]; then
|
||||
# run_tests_with_valgrind
|
||||
# #run_autobahn_test_suite # skip slow autobahn tests
|
||||
#else
|
||||
# echo "skipping autobahn/valgrind tests for feature branch build"
|
||||
run_tests
|
||||
fi
|
||||
#fi
|
||||
|
||||
# Create test coverage data file, combine with the
|
||||
# baseline result and filter out things we don't want.
|
||||
|
65
test/Jamfile
65
test/Jamfile
@@ -9,32 +9,47 @@
|
||||
|
||||
import os ;
|
||||
|
||||
compile config.cpp : <variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no : ;
|
||||
path-constant TEST_MAIN : ../extras/boost/beast/unit_test/main.cpp ;
|
||||
|
||||
compile core.cpp : <variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no : ;
|
||||
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 ;
|
||||
|
||||
compile exemplars.cpp : <variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no : ;
|
||||
alias run-tests :
|
||||
#benchmarks//run-tests # not necessary
|
||||
common//run-tests
|
||||
core//run-tests
|
||||
http//run-tests
|
||||
server//run-tests
|
||||
websocket//run-tests
|
||||
wstest//run-tests
|
||||
zlib//run-tests
|
||||
;
|
||||
|
||||
compile http.cpp : <variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no : ;
|
||||
alias run-fat :
|
||||
benchmarks//run-fat
|
||||
common//run-fat
|
||||
core//run-fat
|
||||
http//run-fat
|
||||
server//run-fat
|
||||
websocket//run-fat
|
||||
#wstest//run-fat # not available
|
||||
zlib//run-fat
|
||||
;
|
||||
explicit run-fat ;
|
||||
|
||||
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 : ;
|
||||
|
||||
build-project benchmarks ;
|
||||
build-project common ;
|
||||
build-project core ;
|
||||
build-project http ;
|
||||
build-project server ;
|
||||
build-project websocket ;
|
||||
build-project wstest ;
|
||||
build-project zlib ;
|
||||
alias build-fat :
|
||||
benchmarks//build-fat
|
||||
common//build-fat
|
||||
core//build-fat
|
||||
http//build-fat
|
||||
server//build-fat
|
||||
websocket//build-fat
|
||||
#wstest//build-fat # not available
|
||||
zlib//build-fat
|
||||
;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,13 +7,15 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test benchmarks :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local SOURCES =
|
||||
buffers.cpp
|
||||
nodejs_parser.cpp
|
||||
parser.cpp
|
||||
#utf8_checker.cpp # causes unnecessary dependencies
|
||||
:
|
||||
<variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no
|
||||
;
|
||||
|
||||
unit-test run-fat : $(TEST_MAIN) $(SOURCES) : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit run-fat ;
|
||||
|
||||
exe build-fat : $(TEST_MAIN) $(SOURCES) : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,15 +7,20 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
exe common-test :
|
||||
local SOURCES =
|
||||
detect_ssl.cpp
|
||||
mime_types.cpp
|
||||
rfc7231.cpp
|
||||
session_alloc.cpp
|
||||
ssl_stream.cpp
|
||||
write_msg.cpp
|
||||
main.cpp
|
||||
:
|
||||
<variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no
|
||||
;
|
||||
|
||||
local RUN_TESTS ; for local f in $(SOURCES) { RUN_TESTS += [ compile $(f) ] ; }
|
||||
alias run-tests : $(RUN_TESTS) : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
|
||||
unit-test run-fat : main.cpp $(SOURCES) : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit run-fat ;
|
||||
|
||||
exe build-fat : $(TEST_MAIN) $(SOURCES) : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test core-tests :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local SOURCES =
|
||||
async_result.cpp
|
||||
bind_handler.cpp
|
||||
buffer_cat.cpp
|
||||
@@ -44,3 +43,12 @@ unit-test core-tests :
|
||||
detail/variant.cpp
|
||||
detail/varint.cpp
|
||||
;
|
||||
|
||||
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 build-fat : $(TEST_MAIN) $(SOURCES) ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test http-tests :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local SOURCES =
|
||||
basic_dynamic_body.cpp
|
||||
basic_file_body.cpp
|
||||
basic_parser.cpp
|
||||
@@ -34,3 +33,12 @@ unit-test http-tests :
|
||||
verb.cpp
|
||||
write.cpp
|
||||
;
|
||||
|
||||
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 build-fat : $(TEST_MAIN) $(SOURCES) ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test server-test :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local SOURCES =
|
||||
file_service.cpp
|
||||
framework.cpp
|
||||
http_async_port.cpp
|
||||
@@ -24,7 +23,13 @@ unit-test server-test :
|
||||
ws_sync_port.cpp
|
||||
ws_upgrade_service.cpp
|
||||
wss_ports.cpp
|
||||
:
|
||||
<variant>coverage:<build>no
|
||||
<variant>ubasan:<build>no
|
||||
;
|
||||
|
||||
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) tests.cpp : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit run-fat ;
|
||||
|
||||
exe build-fat : $(TEST_MAIN) $(SOURCES) tests.cpp : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test websocket-tests :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local SOURCES =
|
||||
doc_snippets.cpp
|
||||
error.cpp
|
||||
option.cpp
|
||||
@@ -19,3 +18,12 @@ unit-test websocket-tests :
|
||||
mask.cpp
|
||||
utf8_checker.cpp
|
||||
;
|
||||
|
||||
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 build-fat : $(TEST_MAIN) $(SOURCES) ;
|
||||
explicit build-fat ;
|
||||
|
@@ -7,6 +7,9 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
exe wstest :
|
||||
alias wstest :
|
||||
main.cpp
|
||||
;
|
||||
explicit wstest ;
|
||||
|
||||
alias run-tests : [ compile main.cpp ] : : : <variant>coverage:<build>no <variant>ubasan:<build>no ;
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
unit-test zlib-tests :
|
||||
../../extras/boost/beast/unit_test/main.cpp
|
||||
local ZLIB_SOURCES =
|
||||
zlib-1.2.11/adler32.c
|
||||
zlib-1.2.11/compress.c
|
||||
zlib-1.2.11/crc32.c
|
||||
@@ -20,7 +19,19 @@ unit-test zlib-tests :
|
||||
zlib-1.2.11/trees.c
|
||||
zlib-1.2.11/uncompr.c
|
||||
zlib-1.2.11/zutil.c
|
||||
;
|
||||
|
||||
local SOURCES =
|
||||
deflate_stream.cpp
|
||||
error.cpp
|
||||
inflate_stream.cpp
|
||||
;
|
||||
|
||||
local RUN_TESTS ; for local f in $(SOURCES) { RUN_TESTS += [ run $(f) $(TEST_MAIN) $(ZLIB_SOURCES) ] ; }
|
||||
alias run-tests : $(RUN_TESTS) ;
|
||||
|
||||
unit-test run-fat : $(TEST_MAIN) $(ZLIB_SOURCES) $(SOURCES) ;
|
||||
explicit run-fat ;
|
||||
|
||||
exe build-fat : $(TEST_MAIN) $(ZLIB_SOURCES) $(SOURCES) ;
|
||||
explicit build-fat ;
|
||||
|
Reference in New Issue
Block a user