Skip to content

Commit

Permalink
increase testing of CMake build files
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Oct 25, 2023
1 parent a0fbf1d commit 11e4fc3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
1 change: 1 addition & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def main(ctx):
windows_cxx("msvc-14.1", "", image="cppalliance/dronevs2017", buildtype="boost", buildscript="drone", environment={"B2_TOOLSET": "msvc-14.1", "B2_CXXSTD": "11,14,17"}, globalenv=globalenv),
windows_cxx("msvc-14.2", "", image="cppalliance/dronevs2019:2", buildtype="boost", buildscript="drone", environment={"B2_TOOLSET": "msvc-14.2", "B2_CXXSTD": "17,latest"}, globalenv=globalenv),
windows_cxx("msvc-14.3", "", image="cppalliance/dronevs2022:1", buildtype="boost", buildscript="drone", environment={"B2_TOOLSET": "msvc-14.3", "B2_CXXSTD": "17,20"}, globalenv=globalenv),
windows_cxx("msvc-14.3 cmake-superproject", "", image="cppalliance/dronevs2022:1", buildtype="cmake-superproject", buildscript="drone", environment={"B2_TOOLSET": "msvc-14.3", "B2_CXXSTD": "17,20"}, globalenv=globalenv),
osx_cxx("macOS: Clang", "clang++", packages="", buildscript="drone", buildtype="boost", xcode_version="13.4.1", environment={'B2_TOOLSET': 'clang', 'B2_CXXSTD': '17'}, globalenv=globalenv)
# osx_cxx("macOS: gcc-12", "g++-12", packages="", buildscript="drone", buildtype="boost", xcode_version="13.4.1", environment={'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '17'}, globalenv=globalenv)
]
Expand Down
43 changes: 43 additions & 0 deletions .drone/drone.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,46 @@ set B2_TARGETS=libs/!SELF!/test libs/!SELF!/example
call !BOOST_ROOT!\libs\!SELF!\ci\build.bat

)
else if "%DRONE_JOB_BUILDTYPE%" == "cmake-superproject" (

echo "Running cmake superproject job"
echo '==================================> INSTALL'
REM there seems to be some problem with b2 bootstrap on Windows
REM when CXX env variable is set
SET "CXX="

git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
cp -prf boost-ci-cloned/ci .
rm -rf boost-ci-cloned
REM source ci/travis/install.sh
REM The contents of install.sh below:

for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
SET BOOST_CI_SRC_FOLDER=%cd%

call ci\common_install.bat

echo '==================================> COMPILE'

if "!CMAKE_OPTIONS!" == "" (
SET CMAKE_OPTIONS=-DBUILD_TESTING=ON
)
if "!CMAKE_SHARED_LIBS!" == "" (
SET CMAKE_SHARED_LIBS=1
)


cd ../../
mkdir __build__ && cd __build__
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 !CMAKE_OPTIONS! ^
-DBOOST_INCLUDE_LIBRARIES=!SELF! -DCMAKE_INSTALL_PREFIX=stage ..
cmake --build . -C Debug
cmake --build . --target install -C Debug
ctest --output-on-failure --no-tests=error -R boost_!SELF! -C Debug

cmake --build . -C Release
cmake --build . --target install -C Release
ctest --output-on-failure --no-tests=error -R boost_!SELF! -C Release

)
16 changes: 10 additions & 6 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,30 @@ common_install
echo '==================================> COMPILE'

export CXXFLAGS="-Wall -Wextra -Werror"
export CMAKE_OPTIONS=${CMAKE_OPTIONS:--DBUILD_TESTING=ON}
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}
if [ $CMAKE_RUN_TESTS != 0 ]; then
CMAKE_TEST_PATTERN="-R boost_$SELF"
fi

mkdir __build_static
cd __build_static
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
-DBOOST_INCLUDE_LIBRARIES=$SELF ..
-DBOOST_INCLUDE_LIBRARIES=$SELF -DCMAKE_INSTALL_PREFIX=stage ..
cmake --build .
ctest --output-on-failure -R boost_$SELF

cmake --build . --target install
ctest --output-on-failure --no-tests=error $CMAKE_TEST_PATTERN
cd ..

if [ "$CMAKE_SHARED_LIBS" = 1 ]; then

mkdir __build_shared
cd __build_shared
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
-DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON ..
-DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=stage ..
cmake --build .
ctest --output-on-failure -R boost_$SELF
cmake --build . --target install
ctest --output-on-failure --no-tests=error $CMAKE_TEST_PATTERN

fi

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run_analyze-bloat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

env:
CMAKE_SHARED_LIBS: '0'
CMAKE_RUN_TESTS: '0'
CMAKE_OPTIONS: >
-DBOOST_JSON_BUILD_TESTS=OFF
-DBOOST_JSON_BUILD_FUZZERS=OFF
Expand Down

0 comments on commit 11e4fc3

Please sign in to comment.