mysql/example/Jamfile
Ruben Perez bc5577ede5 Connection pool
Added any_connection and any_address
Added connection_pool and pooled_connection
Added thread_safety tests
Added defaults.hpp header

close 19
2023-12-20 18:46:31 +01:00

116 lines
3.1 KiB
Plaintext

#
# Copyright (c) 2019-2023 Ruben Perez Hidalgo (rubenperez038 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)
#
import os ;
path-constant this_dir : . ;
# The hostname to use for examples
local hostname = [ os.environ BOOST_MYSQL_SERVER_HOST ] ;
if $(hostname) = ""
{
hostname = "127.0.0.1" ;
}
# "Regular" examples
local regular_examples =
snippets
tutorial
async_callbacks
async_coroutinescpp20
async_futures
metadata
ssl
timeouts
;
for local example in $(regular_examples)
{
run
"$(example).cpp"
/boost/mysql/test//boost_mysql_compiled
:
<testing.arg>"example_user example_password $(hostname)"
;
}
# Order management examples. These must be run several times through a Python script
local order_examples =
prepared_statements_cpp11
prepared_statements_cpp14
stored_procedures_cpp11
stored_procedures_cpp14
;
for local example in $(order_examples)
{
run
"order_management/$(example).cpp"
/boost/mysql/test//boost_mysql_compiled
: requirements
<testing.launcher>"python $(this_dir)/private/run_stored_procedures.py"
<testing.arg>$(hostname)
: target-name "boost_mysql_example_$(example)"
;
}
# Coroutines and any_connection, which requires Boost.Context
local coro_examples =
async_coroutines
any_connection
;
for local example in $(coro_examples)
{
run
"$(example).cpp"
/boost/mysql/test//boost_mysql_compiled
/boost/mysql/test//boost_context_lib
:
<testing.arg>"example_user example_password $(hostname)"
;
}
# UNIX. Honor BOOST_MYSQL_NO_UNIX_SOCKET_TESTS for homogeneity with cmake
if [ os.environ BOOST_MYSQL_NO_UNIX_SOCKET_TESTS ] = "" {
run
unix_socket.cpp
/boost/mysql/test//boost_mysql_compiled
:
<testing.arg>"example_user example_password"
;
}
# Source script
run
source_script.cpp
/boost/mysql/test//boost_mysql_compiled
: requirements
<testing.arg>"example_user example_password $(hostname) $(this_dir)/private/test_script.sql"
;
# Connection pool
run
connection_pool/main.cpp
connection_pool/repository.cpp
connection_pool/handle_request.cpp
connection_pool/server.cpp
/boost/mysql/test//boost_mysql_compiled
/boost/mysql/test//boost_context_lib
/boost/json//boost_json
/boost/url//boost_url
: requirements
<testing.launcher>"python $(this_dir)/private/run_connection_pool.py"
<testing.arg>$(hostname)
# MSVC 14.1 fails with an internal compiler error while building server.cpp for this config
<toolset>msvc-14.1,<address-model>32,<cxxstd>17,<variant>release:<build>no
# Uses heavily Boost.Context coroutines, which aren't fully supported by asan
<address-sanitizer>norecover:<build>no
<address-sanitizer>enable:<build>no
: target-name boost_mysql_example_connection_pool
;