mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-11 21:24:14 +00:00
Fixing missing inline, adding link test (#231)
This commit is contained in:
parent
92a873c746
commit
493a195a54
@ -259,7 +259,7 @@ void fill_n_check_extra_args(std::size_t n, Ts&&... ts) {
|
|||||||
fold(check(ts)...);
|
fold(check(ts)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fill_n_check_extra_args(std::size_t) noexcept {}
|
inline void fill_n_check_extra_args(std::size_t) noexcept {}
|
||||||
|
|
||||||
template <class S, class A, class T, class... Us>
|
template <class S, class A, class T, class... Us>
|
||||||
void fill_n(const std::size_t offset, S& storage, A& axes,
|
void fill_n(const std::size_t offset, S& storage, A& axes,
|
||||||
|
@ -102,6 +102,8 @@ boost_test(TYPE run SOURCES unlimited_storage_test.cpp
|
|||||||
LIBRARIES Boost::histogram Boost::core)
|
LIBRARIES Boost::histogram Boost::core)
|
||||||
boost_test(TYPE run SOURCES utility_test.cpp
|
boost_test(TYPE run SOURCES utility_test.cpp
|
||||||
LIBRARIES Boost::histogram Boost::core)
|
LIBRARIES Boost::histogram Boost::core)
|
||||||
|
boost_test(TYPE link SOURCES link_2_test.cpp link_1_test.cpp
|
||||||
|
LIBRARIES Boost::histogram Boost::core)
|
||||||
|
|
||||||
if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||||
boost_test(TYPE run SOURCES deduction_guides_test.cpp
|
boost_test(TYPE run SOURCES deduction_guides_test.cpp
|
||||||
|
10
test/Jamfile
10
test/Jamfile
@ -69,6 +69,11 @@ alias cxx17 :
|
|||||||
[ requires cpp_deduction_guides ]
|
[ requires cpp_deduction_guides ]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
# Verify that the compile succeeds when linking (missing inline detection)
|
||||||
|
alias compiles :
|
||||||
|
[ link link_2_test.cpp link_1_test.cpp ]
|
||||||
|
;
|
||||||
|
|
||||||
# check that useful error messages are produced when library is used incorrectly
|
# check that useful error messages are produced when library is used incorrectly
|
||||||
alias failure :
|
alias failure :
|
||||||
[ compile-fail axis_category_fail0.cpp ]
|
[ compile-fail axis_category_fail0.cpp ]
|
||||||
@ -113,11 +118,12 @@ alias libserial :
|
|||||||
;
|
;
|
||||||
|
|
||||||
# skipping "failure", since expected failure messages during debugging are confusing
|
# skipping "failure", since expected failure messages during debugging are confusing
|
||||||
alias all : cxx14 cxx17 threading accumulators range units serialization ;
|
alias all : cxx14 cxx17 compiles threading accumulators range units serialization ;
|
||||||
alias minimal : cxx14 cxx17 threading ;
|
alias minimal : cxx14 cxx17 compiles threading ;
|
||||||
|
|
||||||
explicit cxx14 ;
|
explicit cxx14 ;
|
||||||
explicit cxx17 ;
|
explicit cxx17 ;
|
||||||
|
explicit compiles;
|
||||||
explicit failure ;
|
explicit failure ;
|
||||||
explicit threading ;
|
explicit threading ;
|
||||||
explicit accumulators ;
|
explicit accumulators ;
|
||||||
|
8
test/link_1_test.cpp
Normal file
8
test/link_1_test.cpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include <boost/histogram.hpp>
|
||||||
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
|
#include <boost/histogram/ostream.hpp>
|
||||||
|
|
||||||
|
// All files should be include above
|
||||||
|
|
||||||
|
// Simple do-nothing function, used to keep the compiler from throwing away this file
|
||||||
|
int do_nothing() { return 7; }
|
24
test/link_2_test.cpp
Normal file
24
test/link_2_test.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright 2018 Hans Dembinski
|
||||||
|
//
|
||||||
|
// 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/histogram.hpp>
|
||||||
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
|
#include <boost/histogram/ostream.hpp>
|
||||||
|
|
||||||
|
// All files should be included above
|
||||||
|
|
||||||
|
int do_nothing();
|
||||||
|
|
||||||
|
// Verifies there are no functions with missing inline
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
int a = do_nothing();
|
||||||
|
BOOST_TEST_EQ(a, 7);
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user