mirror of
https://github.com/boostorg/dll.git
synced 2026-01-19 04:12:08 +00:00
Test CMake in CI and add initial CMakeLists.txt for tests (#100)
This commit is contained in:
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- toolset: gcc-14
|
- toolset: gcc-14 # Do not remove! It is the only toolset that tests CMake tests down below
|
||||||
cxxstd: "11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
# UBSAN complains on vtables and fails. No ',undefined -fno-sanitize-recover=undefined' flags!
|
# UBSAN complains on vtables and fails. No ',undefined -fno-sanitize-recover=undefined' flags!
|
||||||
@@ -92,6 +92,18 @@ jobs:
|
|||||||
./b2 -d0 headers
|
./b2 -d0 headers
|
||||||
./b2 -j4 variant=debug tools/inspect
|
./b2 -j4 variant=debug tools/inspect
|
||||||
|
|
||||||
|
- name: Run CMake tests
|
||||||
|
if: ${{matrix.toolset == 'gcc-14'}}
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/
|
||||||
|
mkdir __build
|
||||||
|
cd __build
|
||||||
|
cmake -DBUILD_TESTING=1 -DBOOST_INCLUDE_LIBRARIES=dll -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14 ..
|
||||||
|
cmake --build . --target tests
|
||||||
|
ctest --output-on-failure --no-tests=error
|
||||||
|
cd ..
|
||||||
|
rm -rf __build
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root
|
cd ../boost-root
|
||||||
|
|||||||
@@ -10,12 +10,9 @@ project(boost_dll VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
|||||||
|
|
||||||
option(BOOST_DLL_USE_STD_FS "Use std::filesystem instead of Boost.Filesystem" OFF)
|
option(BOOST_DLL_USE_STD_FS "Use std::filesystem instead of Boost.Filesystem" OFF)
|
||||||
|
|
||||||
add_library(boost_dll INTERFACE)
|
add_library(boost_dll_base INTERFACE)
|
||||||
add_library(Boost::dll ALIAS boost_dll)
|
target_include_directories(boost_dll_base INTERFACE include)
|
||||||
|
target_link_libraries(boost_dll_base
|
||||||
target_include_directories(boost_dll INTERFACE include)
|
|
||||||
|
|
||||||
target_link_libraries(boost_dll
|
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Boost::assert
|
Boost::assert
|
||||||
Boost::config
|
Boost::config
|
||||||
@@ -28,13 +25,32 @@ target_link_libraries(boost_dll
|
|||||||
${CMAKE_DL_LIBS}
|
${CMAKE_DL_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_library(boost_dll_std_fs INTERFACE)
|
||||||
|
target_link_libraries(boost_dll_std_fs
|
||||||
|
INTERFACE
|
||||||
|
boost_dll_base
|
||||||
|
)
|
||||||
|
target_compile_definitions(boost_dll_std_fs INTERFACE BOOST_DLL_USE_STD_FS)
|
||||||
|
target_compile_features(boost_dll_std_fs INTERFACE cxx_std_17)
|
||||||
|
|
||||||
|
add_library(boost_dll_boost_fs INTERFACE)
|
||||||
|
target_link_libraries(boost_dll_boost_fs
|
||||||
|
INTERFACE
|
||||||
|
boost_dll_base
|
||||||
|
Boost::filesystem
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_library(boost_dll INTERFACE)
|
||||||
if(BOOST_DLL_USE_STD_FS)
|
if(BOOST_DLL_USE_STD_FS)
|
||||||
target_compile_definitions(boost_dll INTERFACE BOOST_DLL_USE_STD_FS)
|
target_link_libraries(boost_dll INTERFACE boost_dll_std_fs)
|
||||||
target_compile_features(boost_dll INTERFACE cxx_std_17)
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries(boost_dll INTERFACE Boost::filesystem)
|
target_link_libraries(boost_dll INTERFACE boost_dll_boost_fs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_library(Boost::dll ALIAS boost_dll)
|
||||||
|
|
||||||
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||||
|
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ Boost.DLL is a part of the [Boost C++ Libraries](https://github.com/boostorg). I
|
|||||||
|
|
||||||
Branches | Build | Tests coverage | More info
|
Branches | Build | Tests coverage | More info
|
||||||
----------------|-------------- | -------------- |-----------
|
----------------|-------------- | -------------- |-----------
|
||||||
Develop: | [](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/develop) | [](https://coveralls.io/r/apolukhin/Boost.DLL?branch=develop) | [details...](https://www.boost.org/development/tests/develop/developer/dll.html)
|
Develop: | [](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/develop) | [](https://coveralls.io/r/apolukhin/Boost.DLL?branch=develop) | [details...](https://regression.boost.io/develop/developer/dll.html)
|
||||||
Master: | [](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/master) | [](https://coveralls.io/r/apolukhin/Boost.DLL?branch=master) | [details...](https://www.boost.org/development/tests/master/developer/dll.html)
|
Master: | [](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/master) | [](https://coveralls.io/r/apolukhin/Boost.DLL?branch=master) | [details...](https://regression.boost.io/master/developer/dll.html)
|
||||||
|
|
||||||
[Latest developer documentation](https://www.boost.org/doc/libs/develop/doc/html/boost_dll.html)
|
[Latest developer documentation](https://www.boost.org/doc/libs/develop/doc/html/boost_dll.html)
|
||||||
|
|
||||||
|
|||||||
13
test/CMakeLists.txt
Normal file
13
test/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright (c) 2016-2025 Antony Polukhin
|
||||||
|
# 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
|
||||||
|
|
||||||
|
if(NOT TARGET tests)
|
||||||
|
add_custom_target(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(dll_tests_cpp_mangling "cpp_mangling.cpp")
|
||||||
|
target_link_libraries(dll_tests_cpp_mangling Boost::dll)
|
||||||
|
add_test(NAME dll_tests_cpp_mangling COMMAND dll_tests_cpp_mangling)
|
||||||
|
add_dependencies(tests dll_tests_cpp_mangling)
|
||||||
|
|
||||||
Reference in New Issue
Block a user