mirror of
https://github.com/boostorg/range.git
synced 2026-02-07 15:35:38 +01:00
Add test/cmake_subdir_test
This commit is contained in:
18
test/cmake_subdir_test/CMakeLists.txt
Normal file
18
test/cmake_subdir_test/CMakeLists.txt
Normal file
@@ -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.31)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
set(BOOST_INCLUDE_LIBRARIES range)
|
||||
add_subdirectory(../../../.. boostorg/boost)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::range)
|
||||
|
||||
enable_testing()
|
||||
add_test(main main)
|
||||
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
19
test/cmake_subdir_test/main.cpp
Normal file
19
test/cmake_subdir_test/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2026 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string s( "foo" );
|
||||
|
||||
assert( boost::begin( s ) == s.begin() );
|
||||
assert( boost::end( s ) == s.end() );
|
||||
assert( boost::empty( s ) == s.empty() );
|
||||
assert( boost::size( s ) == s.size() );
|
||||
}
|
||||
Reference in New Issue
Block a user