Update from hash_predef.

This commit is contained in:
Rene Rivera
2025-02-02 23:07:45 -06:00
parent 0727fa7ce3
commit 6f2bd13716
2 changed files with 94 additions and 17 deletions

View File

@ -250,8 +250,50 @@ stages:
popd popd
displayName: Test displayName: Test
- stage: Extra
dependsOn: [Test]
jobs:
- job: 'Linux'
strategy:
matrix:
TinyCC: {
EXE: tcc, PACKAGES: tcc, VM_IMAGE: 'ubuntu-latest',
TOOLSET: cc, VERSION: "tcc~0.9.27",
B2_CONFIG: '<cflags>"-std=c11" <-soname>-soname',
B2_ARGS: 'c' }
pool:
vmImage: $(VM_IMAGE)
continueOnError: 'true'
steps:
- bash: |
set -e
uname -a
./tools/ci/linux-cxx-install.sh
displayName: 'Install CXX'
- bash: |
set -e
pushd ${HOME}
wget -nv https://github.com/bfgroup/b2/archive/main.tar.gz
tar -zxf main.tar.gz
cd b2-main
./bootstrap.sh
sudo ./b2 install
popd
displayName: 'Install B2'
- bash: |
set -e
EXE_PATH=`which ${EXE}`
echo "using ${TOOLSET} : ${VERSION} : ${EXE_PATH} : ${B2_CONFIG} ;" > ${HOME}/user-config.jam
pushd test
b2 --verbose-test -a toolset=${TOOLSET} ${B2_ARGS}
b2 --debug-configuration -a toolset=${TOOLSET} ${B2_ARGS}
popd
displayName: Test
- stage: WebsiteUpdate - stage: WebsiteUpdate
displayName: 'Website Update' displayName: 'Website Update'
dependsOn: [Test]
condition: and(in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/develop'), eq(variables['Build.Repository.Name'], 'grafikrobot/hash-predef')) condition: and(in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/develop'), eq(variables['Build.Repository.Name'], 'grafikrobot/hash-predef'))
jobs: jobs:

View File

@ -18,13 +18,22 @@ project
using testing ; using testing ;
test-suite predef-info : alias predef-info-c :
[ run info_as_cpp.cpp : : : <test-info>always_show_run_output ]
[ run info_as_c.c : : : <test-info>always_show_run_output ] [ run info_as_c.c : : : <test-info>always_show_run_output ]
[ run info_as_objcpp.mm : : : <test-info>always_show_run_output <conditional>@objc ]
[ run info_as_objc.m : : : <test-info>always_show_run_output <conditional>@objc ]
; ;
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 ;
rule objc ( props * ) rule objc ( props * )
{ {
if ! ( <target-os>darwin in $(props) ) if ! ( <target-os>darwin in $(props) )
@ -33,7 +42,7 @@ rule objc ( props * )
} }
} }
test-suite predef : alias predef :
[ run version.cpp ] [ run version.cpp ]
[ run make.cpp ] [ run make.cpp ]
[ compile macos_endian.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ] [ compile macos_endian.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ]
@ -47,30 +56,50 @@ test-suite predef :
[ compile platform_windows.cpp ] [ compile platform_windows.cpp ]
; ;
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 ; local single_header_cpp ;
for local h in [ glob-tree-ex ../include/boost/predef : *.h ] for local h in [ glob-tree-ex ../include/boost/predef : *.h ]
{ {
local header_include = [ path.relative $(h) ../include ] ; local header_include = [ path.relative $(h) ../include ] ;
local header_cpp = [ regex.replace $(header_include:S=.cpp) "/" "_" ] ; local header_src = [ regex.replace $(header_include:S=)_cpp.cpp "/" "_" ] ;
.HEADER($(header_cpp:B:S=)) = $(header_include) ; local header_target = $(header_src:B:S=) ;
make $(header_cpp) : : @gen_single_header_cpp ; .HEADER($(header_target)) = $(header_include) ;
explicit $(header_cpp) ; make $(header_src) : : @gen_single_header_c_or_cpp ;
compile $(header_cpp) : <warnings-as-errors>on <warnings>all : $(header_cpp:B:S=) ; explicit $(header_src) ;
explicit $(header_cpp:B:S=) ; compile $(header_src) : <warnings-as-errors>on <warnings>all : $(header_target) ;
single_header_cpp += $(header_cpp:B:S=) ; explicit $(header_target) ;
single_header_cpp += $(header_target) ;
} }
test-suite predef-headers : $(single_header_cpp) ; 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 ] ; .file_touch_cmd = [ common.file-touch-command ] ;
rule gen_single_header_cpp ( target * : source * : properties * ) rule gen_single_header_c_or_cpp ( target * : source * : properties * )
{ {
HEADER on $(target) = $(.HEADER($(target[1]:B))) ; TEXT on $(target) = "
#include <$(.HEADER($(target[1]:B)))>
typedef char predef_single_header_test;
" ;
} }
actions gen_single_header_cpp actions gen_single_header_c_or_cpp
{ {
$(.file_touch_cmd) @($(<):<=":>=":O=F:E=#include <$(HEADER)>) $(.file_touch_cmd) @($(<):<=":>=":O=F:E=$(TEXT))
} }
# Minimal testing done for predef for CI. Since # Minimal testing done for predef for CI. Since
@ -83,8 +112,14 @@ alias full : predef predef-info ;
# Extra's target. # Extra's target.
alias extra : predef-headers ; alias extra : predef-headers ;
# Language specific tests only.
alias c : predef-info-c predef-headers-c ;
alias cpp : predef-info-cpp predef-headers-cpp ;
alias all : predef predef-info predef-headers ; alias all : predef predef-info predef-headers ;
explicit minimal ; explicit minimal ;
explicit extra ; explicit extra ;
explicit all ; explicit all ;
explicit c ;
explicit cpp ;