mirror of
https://github.com/boostorg/contract.git
synced 2026-02-26 16:42:19 +00:00
216 lines
6.3 KiB
Plaintext
216 lines
6.3 KiB
Plaintext
|
|
import testing ;
|
|
import os ;
|
|
|
|
if ! [ os.environ BOOST_ROOT ] {
|
|
exit "error: set BOOST_ROOT environment variable to Boost root directory" ;
|
|
}
|
|
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
|
|
echo "using: Boost libraries from \"$(BOOST_ROOT)\" (see $BOOST_ROOT)" ;
|
|
use-project boost : $(BOOST_ROOT) ;
|
|
|
|
project
|
|
:
|
|
requirements
|
|
<toolset>gcc:<cxxflags>-std=c++11
|
|
<toolset>clang:<cxxflags>-std=c++11
|
|
<include>"./include"
|
|
<include>$(BOOST_ROOT)
|
|
<library-path>$(BOOST_ROOT)/stage/lib
|
|
;
|
|
|
|
rule subdir-usage ( ) {
|
|
echo ;
|
|
echo "usage: [time] bjam [-aq toolset=msvc,gcc,clang] DIR_NAME[-FILE_NAME[-no_...]] [--clean] [; echo $?]" ;
|
|
echo "where: -no_... = -no[_entryinv][_pre][_exitinv][_post] | -no_all | n/a" ;
|
|
echo ;
|
|
}
|
|
|
|
rule subdir-compile-fail ( subdir : cpp_fname : requirements * ) {
|
|
compile-fail $(subdir)/$(cpp_fname).cpp
|
|
:
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)
|
|
;
|
|
}
|
|
|
|
rule subdir-run ( subdir : cpp_fname : requirements * ) {
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)
|
|
;
|
|
}
|
|
|
|
rule subdir-run-withno ( subdir : cpp_fname : requirements * ) {
|
|
subdir-run $(subdir) : $(cpp_fname) : $(requirements) ;
|
|
# Compilation of 1 contract off.
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_pre
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_exitinv
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_post
|
|
;
|
|
# Compilation of 2 contracts off.
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_exitinv
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_post
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_pre_exitinv
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_pre_post
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_exitinv_post
|
|
;
|
|
# Compilation of 3 contracts off.
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_pre_exitinv_post
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_exitinv_post
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_post
|
|
;
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_exitinv
|
|
;
|
|
# Compilation of all 4 contracts off.
|
|
run $(subdir)/$(cpp_fname).cpp : :
|
|
:
|
|
<define>BOOST_CONTRACT_CONFIG_NO_ENTRY_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_PRECONDITIONS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_EXIT_INVARIANTS
|
|
<define>BOOST_CONTRACT_CONFIG_NO_POSTCONDITIONS
|
|
<include>$(subdir)
|
|
$(requirements)
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_exitinv_post
|
|
;
|
|
# Group all compilation off targets.
|
|
test-suite $(subdir)-$(cpp_fname)-no_all
|
|
:
|
|
$(subdir)-$(cpp_fname)-no_entryinv
|
|
$(subdir)-$(cpp_fname)-no_pre
|
|
$(subdir)-$(cpp_fname)-no_exitinv
|
|
$(subdir)-$(cpp_fname)-no_post
|
|
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre
|
|
$(subdir)-$(cpp_fname)-no_entryinv_exitinv
|
|
$(subdir)-$(cpp_fname)-no_entryinv_post
|
|
$(subdir)-$(cpp_fname)-no_pre_exitinv
|
|
$(subdir)-$(cpp_fname)-no_pre_post
|
|
$(subdir)-$(cpp_fname)-no_exitinv_post
|
|
|
|
$(subdir)-$(cpp_fname)-no_pre_exitinv_post
|
|
$(subdir)-$(cpp_fname)-no_entryinv_exitinv_post
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_post
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_exitinv
|
|
|
|
$(subdir)-$(cpp_fname)-no_entryinv_pre_exitinv_post
|
|
;
|
|
}
|
|
|