1
0
forked from boostorg/mp11

Add cmake_subdir_test

This commit is contained in:
Peter Dimov
2018-09-30 21:29:36 +03:00
parent 8c278c84dd
commit 1a7fc19caa
3 changed files with 36 additions and 1 deletions

View File

@@ -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 ..

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)
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>)

View 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;
}