Files
predef/test/build.jam

126 lines
3.8 KiB
Plaintext
Raw Permalink Normal View History

2023-03-12 23:07:07 -05:00
# Copyright Rene Rivera 2011-2023
# 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-search ../tools/check ;
2023-03-12 23:07:07 -05:00
import predef : require check : predef-require predef-check ;
import common ;
import path ;
import regex ;
project
: requirements
# Add explicit dependency since we don't have header scanner for
# .m and .mm files.
2023-03-12 23:07:07 -05:00
<dependency>../include/boost/predef.h
;
using testing ;
2025-02-02 23:07:45 -06:00
alias predef-info-c :
[ run info_as_c.c : : : <test-info>always_show_run_output ]
;
2025-02-02 23:07:45 -06:00
alias predef-info-cpp :
[ run info_as_cpp.cpp : : : <test-info>always_show_run_output ]
;
alias predef-info-objc :
[ run info_as_objcpp.mm : : : <test-info>always_show_run_output ]
[ run info_as_objc.m : : : <test-info>always_show_run_output ]
: <conditional>@objc
;
alias predef-info : predef-info-c predef-info-cpp predef-info-objc ;
2021-10-24 12:51:46 -05:00
rule objc ( props * )
{
if ! ( <target-os>darwin in $(props) )
{
return <build>no ;
}
}
2025-02-02 23:07:45 -06:00
alias predef :
[ run version.cpp ]
[ run make.cpp ]
[ compile macos_endian.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ]
[ compile macos_vs_bsd.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ]
[ run check_value.cpp : : : <test-info>always_show_run_output
[ predef-check "BOOST_COMP_CLANG > 0.0.0" "BOOST_OS_LINUX == 0" : : <cxxflags>-DCHECK_VALUE=true ] ]
[ run workaround.cpp ]
[ compile workaround_strict_config.cpp ]
[ run tested_at.cpp ]
[ compile-fail tested_at_outdated.cpp : <test-info>always_show_run_output ]
2023-03-12 23:07:07 -05:00
[ compile platform_windows.cpp ]
;
2015-05-26 20:57:50 -05:00
2025-02-02 23:07:45 -06:00
local single_header_c ;
for local h in [ glob-tree-ex ../include/boost/predef : *.h ]
{
local header_include = [ path.relative $(h) ../include ] ;
local header_src = [ regex.replace $(header_include:S=)_c.c "/" "_" ] ;
local header_target = $(header_src:B:S=) ;
.HEADER($(header_target)) = $(header_include) ;
make $(header_src) : : @gen_single_header_c_or_cpp ;
explicit $(header_src) ;
compile $(header_src) : <warnings-as-errors>on <warnings>all : $(header_target) ;
explicit $(header_target) ;
single_header_c += $(header_target) ;
}
local single_header_cpp ;
2023-03-12 23:07:07 -05:00
for local h in [ glob-tree-ex ../include/boost/predef : *.h ]
{
2023-03-12 23:07:07 -05:00
local header_include = [ path.relative $(h) ../include ] ;
2025-02-02 23:07:45 -06:00
local header_src = [ regex.replace $(header_include:S=)_cpp.cpp "/" "_" ] ;
local header_target = $(header_src:B:S=) ;
.HEADER($(header_target)) = $(header_include) ;
make $(header_src) : : @gen_single_header_c_or_cpp ;
explicit $(header_src) ;
compile $(header_src) : <warnings-as-errors>on <warnings>all : $(header_target) ;
explicit $(header_target) ;
single_header_cpp += $(header_target) ;
}
2025-02-02 23:07:45 -06:00
alias predef-headers-c : $(single_header_c) ;
alias predef-headers-cpp : $(single_header_cpp) ;
alias predef-headers : predef-headers-c predef-headers-cpp ;
.file_touch_cmd = [ common.file-touch-command ] ;
2025-02-02 23:07:45 -06:00
rule gen_single_header_c_or_cpp ( target * : source * : properties * )
{
2025-02-02 23:07:45 -06:00
TEXT on $(target) = "
#include <$(.HEADER($(target[1]:B)))>
typedef char predef_single_header_test;
" ;
}
2025-02-02 23:07:45 -06:00
actions gen_single_header_c_or_cpp
{
2025-02-02 23:07:45 -06:00
$(.file_touch_cmd) @($(<):<=":>=":O=F:E=$(TEXT))
}
2015-05-26 20:57:50 -05:00
# Minimal testing done for predef for CI. Since
# we don't have many we can just do all of them.
alias minimal : predef predef-info ;
# Full testing target for regular regression tests.
alias full : predef predef-info ;
# Extra's target.
alias extra : predef-headers ;
2025-02-02 23:07:45 -06:00
# Language specific tests only.
alias c : predef-info-c predef-headers-c ;
alias cpp : predef-info-cpp predef-headers-cpp ;
2023-03-12 23:07:07 -05:00
alias all : predef predef-info predef-headers ;
2015-05-26 20:57:50 -05:00
explicit minimal ;
explicit extra ;
2023-03-12 23:07:07 -05:00
explicit all ;
2025-02-02 23:07:45 -06:00
explicit c ;
explicit cpp ;