From a0de6450c0ac4569e508d03c0b7b472e3de5c45b Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 27 Jan 2021 08:56:59 +0000 Subject: [PATCH 1/4] Add first cut at CMake tests. --- CMakeLists.txt | 2 ++ test/cmake_install_test/CMakeLists.txt | 18 ++++++++++++++++++ test/cmake_subdir_test/CMakeLists.txt | 22 ++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 test/cmake_install_test/CMakeLists.txt create mode 100644 test/cmake_subdir_test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e380b4ad..73dd46b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,8 @@ target_link_libraries(boost_regex INTERFACE Boost::config Boost::throw_exception + Boost::predef + Boost::assert ) # boost_install requires PROJECT_VERSION diff --git a/test/cmake_install_test/CMakeLists.txt b/test/cmake_install_test/CMakeLists.txt new file mode 100644 index 00000000..f0fde175 --- /dev/null +++ b/test/cmake_install_test/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright 2018, 2019 Peter Dimov +# 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 + +cmake_minimum_required(VERSION 3.5...3.16) + +project(cmake_install_test LANGUAGES CXX) + +find_package(boost_regex REQUIRED) +find_package(boost_core REQUIRED) + +add_executable(quick ../quick.cpp) +target_link_libraries(quick Boost::regex Boost::core) + +enable_testing() +add_test(quick quick) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt new file mode 100644 index 00000000..ddb7b024 --- /dev/null +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2018, 2019 Peter Dimov +# 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 + +cmake_minimum_required(VERSION 3.5...3.16) + +project(cmake_subdir_test LANGUAGES CXX) + +add_subdirectory(../.. boostorg/reegx) +add_subdirectory(../../../config boostorg/config) +add_subdirectory(../../../core boostorg/core) +add_subdirectory(../../../assert boostorg/assert) +add_subdirectory(../../../throw_exception boostorg/throw_exception) +add_subdirectory(../../../predef boostorg/predef) + +add_executable(quick ../quick.cpp) +target_link_libraries(quick Boost::regex Boost::core) + +enable_testing() +add_test(quick quick) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) From 8a44a1423ec7e7f23ce58c693049f1a82bf0694f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 27 Jan 2021 10:27:47 +0000 Subject: [PATCH 2/4] Add GHA for CMake tests. --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de4c639c..ecc639e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,3 +248,58 @@ jobs: - name: Test run: ..\..\..\b2 --hash %ARGS% working-directory: ../boost-root/libs/regex/test + ubuntu-focal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + steps: + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/regex + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: CMake Test + working-directory: ../boost-root + run: | + mkdir __build__ && cd __build__ + cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES="regex;core" -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=~/.local .. + cmake --build . --target install + cd ../libs/regex/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=~/.local .. + cmake --build . + cmake --build . --target check + ubuntu-focal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + steps: + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/regex + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: CMake Test + working-directory: ../boost-root/libs/regex/test + run: | + cd cmake_subdir_test && mkdir __build__ && cd __build__ + cmake .. + cmake --build . + cmake --build . --target check From c330d40739ac506329444534537ee19882f643c7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 27 Jan 2021 10:31:17 +0000 Subject: [PATCH 3/4] Correct GHA script. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecc639e3..84fbf3f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,7 +248,7 @@ jobs: - name: Test run: ..\..\..\b2 --hash %ARGS% working-directory: ../boost-root/libs/regex/test - ubuntu-focal: + ubuntu-cmake-install: runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -277,7 +277,7 @@ jobs: cmake -DCMAKE_INSTALL_PREFIX=~/.local .. cmake --build . cmake --build . --target check - ubuntu-focal: + ubuntu-cmake-check: runs-on: ubuntu-20.04 strategy: fail-fast: false From 7f1b8ff5f1d4b578cdd45a4d533eb012701918a0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 27 Jan 2021 10:35:25 +0000 Subject: [PATCH 4/4] GHA need to check out the repro! --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84fbf3f0..15f74076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,6 +253,9 @@ jobs: strategy: fail-fast: false steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep @@ -282,6 +285,9 @@ jobs: strategy: fail-fast: false steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep