forked from boostorg/mp11
Add cmake_subdir_test
This commit is contained in:
12
.travis.yml
12
.travis.yml
@@ -223,7 +223,7 @@ matrix:
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
compiler: clang++
|
||||
env: CMAKE=1
|
||||
install: true
|
||||
script:
|
||||
@@ -231,6 +231,16 @@ matrix:
|
||||
- cmake ..
|
||||
- cmake --build . --target check
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: CMAKE_SUBDIR_TEST=1
|
||||
install: true
|
||||
script:
|
||||
- cd test/cmake_subir_test && mkdir __build__ && cd __build__
|
||||
- cmake ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
|
17
test/cmake_subdir_test/CMakeLists.txt
Normal file
17
test/cmake_subdir_test/CMakeLists.txt
Normal 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)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
add_subdirectory(../.. boostorg/mp11)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::mp11)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME main COMMAND main)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
8
test/cmake_subdir_test/main.cpp
Normal file
8
test/cmake_subdir_test/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <boost/mp11.hpp>
|
||||
using namespace boost::mp11;
|
||||
|
||||
int main()
|
||||
{
|
||||
using L1 = mp_list<int, float, int, float>;
|
||||
return mp_size<mp_unique<L1>>::value == 2? 0: 1;
|
||||
}
|
Reference in New Issue
Block a user