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