forked from boostorg/assert
Add project version, test
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
project(BoostAssert LANGUAGES CXX)
|
project(BoostAssert VERSION 1.69.0 LANGUAGES CXX)
|
||||||
|
|
||||||
add_library(boost_assert INTERFACE)
|
add_library(boost_assert INTERFACE)
|
||||||
add_library(Boost::assert ALIAS boost_assert)
|
add_library(Boost::assert ALIAS boost_assert)
|
||||||
|
@ -3,3 +3,4 @@
|
|||||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::assert Boost::core)
|
boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::assert Boost::core)
|
||||||
|
boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION} LIBRARIES Boost::core Boost::config)
|
||||||
|
27
test/check_cmake_version.cpp
Normal file
27
test/check_cmake_version.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Check whether the version in CMakeLists.txt is up to date
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/version.hpp>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
int main( int ac, char const* av[] )
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( ac, 2 );
|
||||||
|
|
||||||
|
if( ac >= 2 )
|
||||||
|
{
|
||||||
|
char version[ 64 ];
|
||||||
|
std::sprintf( version, "%d.%d.%d", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100 );
|
||||||
|
|
||||||
|
BOOST_TEST_CSTR_EQ( av[1], version );
|
||||||
|
}
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user