Add cmake_install_test, cmake_subdir_test

This commit is contained in:
Peter Dimov
2019-12-26 17:55:24 +02:00
parent 37a31584ca
commit 44bed90749
5 changed files with 73 additions and 1 deletions

View File

@@ -289,9 +289,32 @@ matrix:
env: CMAKE=1
script:
- mkdir __build__ && cd __build__
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ..
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 ..
- ctest --output-on-failure -R boost_assert
- os: linux
env: CMAKE_SUBDIR=1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- git clone -b $BOOST_BRANCH https://github.com/boostorg/config.git ../config
script:
- cd test/cmake_subdir_test && mkdir __build__ && cd __build__
- cmake ..
- cmake --build .
- cmake --build . --target check
- os: linux
env: CMAKE_INSTALL=1
script:
- mkdir __build__ && cd __build__
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 -DBOOST_INCLUDE_LIBRARIES=assert,config -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake --build . --target install
- cd ../test/cmake_install_test && mkdir __build__ && cd __build__
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
- cmake --build .
- cmake --build . --target check
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..

View File

@@ -0,0 +1,17 @@
# Copyright 2018 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_assert REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main Boost::assert)
enable_testing()
add_test(NAME main COMMAND main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,7 @@
#include <boost/assert.hpp>
int main()
{
int x = 5;
BOOST_ASSERT( x > 4 );
}

View File

@@ -0,0 +1,18 @@
# Copyright 2018 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(../../../assert boostorg/assert)
add_subdirectory(../../../config boostorg/config)
add_executable(main main.cpp)
target_link_libraries(main Boost::assert)
enable_testing()
add_test(NAME main COMMAND main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,7 @@
#include <boost/assert.hpp>
int main()
{
int x = 5;
BOOST_ASSERT( x > 4 );
}