mysql/example/Jamfile
Anarthal (Rubén Pérez) 20335ac99e
Modular Boost CI fixes
Added a boost.mysql.valgrind b2 feature
Suppress warnings in dependencies

close #338
2024-09-05 17:00:38 +02:00

126 lines
3.9 KiB
Plaintext

#
# Copyright (c) 2019-2024 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 ;
project : requirements <library>/boost/mysql//boost_mysql ;
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" ;
}
# Builds and run a "regular" example
rule run_regular_example (
example_name :
sources *
)
{
run
"$(example_name).cpp"
/boost/mysql/test//boost_mysql_compiled
/boost/mysql/test//launch_with_valgrind
$(sources)
: requirements
<testing.arg>"example_user example_password $(hostname)"
: target-name "boost_mysql_example_$(example_name)"
;
}
# Builds and runs a example that needs a Python runner
rule run_python_example (
example_name :
python_runner :
sources *
)
{
run
$(sources)
/boost/mysql/test//boost_mysql_compiled
: requirements
<testing.launcher>"python $(this_dir)/private/$(python_runner)"
<testing.arg>$(hostname)
: target-name "boost_mysql_example_$(example_name)"
;
}
# "Regular" examples
run_regular_example tutorial ;
run_regular_example async_callbacks ;
run_regular_example async_coroutinescpp20 ;
run_regular_example async_futures ;
run_regular_example metadata ;
run_regular_example ssl ;
run_regular_example timeouts ;
run_regular_example pipeline ;
run_regular_example async_coroutines : /boost/mysql/test//boost_context_lib ;
run_regular_example any_connection : /boost/mysql/test//boost_context_lib ;
# Order management examples
local order_examples =
prepared_statements_cpp11
prepared_statements_cpp14
stored_procedures_cpp11
stored_procedures_cpp14
;
for local example in $(order_examples)
{
run_python_example $(example) : run_stored_procedures.py : order_management/$(example).cpp ;
}
# Other examples that need a Python script
run_python_example patch_updates : run_patch_updates.py : patch_updates.cpp ;
run_python_example dynamic_filters : run_dynamic_filters.py : dynamic_filters.cpp /boost/mysql/test//boost_context_lib ;
run_python_example batch_inserts : run_batch_inserts.py : batch_inserts.cpp /boost/mysql/test//boost_json_lib ;
run_python_example batch_inserts_generic : run_batch_inserts.py : batch_inserts_generic.cpp /boost/mysql/test//boost_json_lib ;
# UNIX. Don't run under Windows systems
run
unix_socket.cpp
/boost/mysql/test//boost_mysql_compiled
:
requirements
<target-os>windows:<build>no
<testing.arg>"example_user example_password"
;
# Source script
run
source_script.cpp
/boost/mysql/test//boost_mysql_compiled
/boost/mysql/test//launch_with_valgrind
: 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/mysql/test//boost_json_lib
/boost/url//boost_url
/boost/mysql/test//boost_beast_lib
: 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
;