mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-09 23:04:07 +00:00
Get full coverage with tests only
This commit is contained in:
parent
7b5f7ab4f5
commit
a06505d877
@ -40,7 +40,7 @@ matrix:
|
|||||||
- name: "gcc-5: coverage"
|
- name: "gcc-5: coverage"
|
||||||
script:
|
script:
|
||||||
- ../../b2 -j2 toolset=gcc-5 cxxstd=14 warnings-as-errors=on
|
- ../../b2 -j2 toolset=gcc-5 cxxstd=14 warnings-as-errors=on
|
||||||
histogram_coverage
|
histogram_coverage test
|
||||||
after_success:
|
after_success:
|
||||||
- GCOV=gcov-5 tools/cov.sh
|
- GCOV=gcov-5 tools/cov.sh
|
||||||
|
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/axis/category.hpp>
|
#include <boost/histogram/axis/category.hpp>
|
||||||
#include <boost/histogram/axis/ostream.hpp>
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
|
#include <boost/histogram/detail/cat.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
|
|
||||||
@ -35,6 +37,18 @@ int main() {
|
|||||||
BOOST_TEST_EQ(static_cast<const axis::category<std::string>&>(a).metadata(), "foo");
|
BOOST_TEST_EQ(static_cast<const axis::category<std::string>&>(a).metadata(), "foo");
|
||||||
a.metadata() = "bar";
|
a.metadata() = "bar";
|
||||||
BOOST_TEST_EQ(static_cast<const axis::category<std::string>&>(a).metadata(), "bar");
|
BOOST_TEST_EQ(static_cast<const axis::category<std::string>&>(a).metadata(), "bar");
|
||||||
|
BOOST_TEST_EQ(a.size(), 3);
|
||||||
|
BOOST_TEST_EQ(a.index(A), 0);
|
||||||
|
BOOST_TEST_EQ(a.index(B), 1);
|
||||||
|
BOOST_TEST_EQ(a.index(C), 2);
|
||||||
|
BOOST_TEST_EQ(a.index(other), 3);
|
||||||
|
BOOST_TEST_EQ(a.value(0), A);
|
||||||
|
BOOST_TEST_EQ(a.value(1), B);
|
||||||
|
BOOST_TEST_EQ(a.value(2), C);
|
||||||
|
BOOST_TEST_THROWS(a.value(3), std::out_of_range);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a),
|
||||||
|
"category(\"A\", \"B\", \"C\", metadata=\"bar\", options=overflow)");
|
||||||
|
|
||||||
axis::category<std::string> b;
|
axis::category<std::string> b;
|
||||||
BOOST_TEST_NE(a, b);
|
BOOST_TEST_NE(a, b);
|
||||||
@ -50,15 +64,6 @@ int main() {
|
|||||||
BOOST_TEST_NE(c, d);
|
BOOST_TEST_NE(c, d);
|
||||||
d = std::move(c);
|
d = std::move(c);
|
||||||
BOOST_TEST_EQ(d, a);
|
BOOST_TEST_EQ(d, a);
|
||||||
BOOST_TEST_EQ(a.size(), 3);
|
|
||||||
BOOST_TEST_EQ(a.index(A), 0);
|
|
||||||
BOOST_TEST_EQ(a.index(B), 1);
|
|
||||||
BOOST_TEST_EQ(a.index(C), 2);
|
|
||||||
BOOST_TEST_EQ(a.index(other), 3);
|
|
||||||
BOOST_TEST_EQ(a.value(0), A);
|
|
||||||
BOOST_TEST_EQ(a.value(1), B);
|
|
||||||
BOOST_TEST_EQ(a.value(2), C);
|
|
||||||
BOOST_TEST_THROWS(a.value(3), std::out_of_range);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// axis::category with growth
|
// axis::category with growth
|
||||||
@ -73,6 +78,8 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.size(), 3);
|
BOOST_TEST_EQ(a.size(), 3);
|
||||||
BOOST_TEST_EQ(a.update(10), std::make_pair(2, 0));
|
BOOST_TEST_EQ(a.update(10), std::make_pair(2, 0));
|
||||||
BOOST_TEST_EQ(a.size(), 3);
|
BOOST_TEST_EQ(a.size(), 3);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "category(5, 1, 10, options=growth)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterators
|
// iterators
|
||||||
|
@ -7,8 +7,10 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/axis/integer.hpp>
|
#include <boost/histogram/axis/integer.hpp>
|
||||||
#include <boost/histogram/axis/ostream.hpp>
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
|
#include <boost/histogram/detail/cat.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
|
|
||||||
@ -32,6 +34,18 @@ int main() {
|
|||||||
BOOST_TEST_EQ(static_cast<const axis::integer<double>&>(a).metadata(), "bar");
|
BOOST_TEST_EQ(static_cast<const axis::integer<double>&>(a).metadata(), "bar");
|
||||||
BOOST_TEST_EQ(a.bin(-1).lower(), -std::numeric_limits<double>::infinity());
|
BOOST_TEST_EQ(a.bin(-1).lower(), -std::numeric_limits<double>::infinity());
|
||||||
BOOST_TEST_EQ(a.bin(a.size()).upper(), std::numeric_limits<double>::infinity());
|
BOOST_TEST_EQ(a.bin(a.size()).upper(), std::numeric_limits<double>::infinity());
|
||||||
|
BOOST_TEST_EQ(a.index(-10), -1);
|
||||||
|
BOOST_TEST_EQ(a.index(-2), -1);
|
||||||
|
BOOST_TEST_EQ(a.index(-1), 0);
|
||||||
|
BOOST_TEST_EQ(a.index(0), 1);
|
||||||
|
BOOST_TEST_EQ(a.index(1), 2);
|
||||||
|
BOOST_TEST_EQ(a.index(2), 3);
|
||||||
|
BOOST_TEST_EQ(a.index(10), 3);
|
||||||
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 3);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a),
|
||||||
|
"integer(-1, 2, metadata=\"bar\", options=underflow | overflow)");
|
||||||
|
|
||||||
axis::integer<double> b;
|
axis::integer<double> b;
|
||||||
BOOST_TEST_NE(a, b);
|
BOOST_TEST_NE(a, b);
|
||||||
b = a;
|
b = a;
|
||||||
@ -42,14 +56,6 @@ int main() {
|
|||||||
BOOST_TEST_NE(c, d);
|
BOOST_TEST_NE(c, d);
|
||||||
d = std::move(c);
|
d = std::move(c);
|
||||||
BOOST_TEST_EQ(d, a);
|
BOOST_TEST_EQ(d, a);
|
||||||
BOOST_TEST_EQ(a.index(-10), -1);
|
|
||||||
BOOST_TEST_EQ(a.index(-2), -1);
|
|
||||||
BOOST_TEST_EQ(a.index(-1), 0);
|
|
||||||
BOOST_TEST_EQ(a.index(0), 1);
|
|
||||||
BOOST_TEST_EQ(a.index(1), 2);
|
|
||||||
BOOST_TEST_EQ(a.index(2), 3);
|
|
||||||
BOOST_TEST_EQ(a.index(10), 3);
|
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// axis::integer with int type
|
// axis::integer with int type
|
||||||
@ -64,6 +70,8 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(1), 2);
|
BOOST_TEST_EQ(a.index(1), 2);
|
||||||
BOOST_TEST_EQ(a.index(2), 3);
|
BOOST_TEST_EQ(a.index(2), 3);
|
||||||
BOOST_TEST_EQ(a.index(10), 3);
|
BOOST_TEST_EQ(a.index(10), 3);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "integer(-1, 2, options=underflow | overflow)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// axis::integer int,circular
|
// axis::integer int,circular
|
||||||
@ -79,6 +87,8 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(0), 1);
|
BOOST_TEST_EQ(a.index(0), 1);
|
||||||
BOOST_TEST_EQ(a.index(1), 0);
|
BOOST_TEST_EQ(a.index(1), 0);
|
||||||
BOOST_TEST_EQ(a.index(2), 1);
|
BOOST_TEST_EQ(a.index(2), 1);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "integer(-1, 1, options=circular)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// axis::integer double,circular
|
// axis::integer double,circular
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015-2017 Hans Dembinski
|
// Copyright 2015-2019 Hans Dembinski
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// (See accompanying file LICENSE_1_0.txt
|
// (See accompanying file LICENSE_1_0.txt
|
||||||
@ -7,10 +7,12 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/axis/ostream.hpp>
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
#include <boost/histogram/axis/regular.hpp>
|
#include <boost/histogram/axis/regular.hpp>
|
||||||
|
#include <boost/histogram/detail/cat.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include "is_close.hpp"
|
#include "is_close.hpp"
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
|
|
||||||
@ -49,7 +51,14 @@ int main() {
|
|||||||
BOOST_TEST_EQ(static_cast<const axis::regular<>&>(a).metadata(), "foo");
|
BOOST_TEST_EQ(static_cast<const axis::regular<>&>(a).metadata(), "foo");
|
||||||
a.metadata() = "bar";
|
a.metadata() = "bar";
|
||||||
BOOST_TEST_EQ(static_cast<const axis::regular<>&>(a).metadata(), "bar");
|
BOOST_TEST_EQ(static_cast<const axis::regular<>&>(a).metadata(), "bar");
|
||||||
|
BOOST_TEST_EQ(a.value(0), -2);
|
||||||
|
BOOST_TEST_EQ(a.value(1), -1);
|
||||||
|
BOOST_TEST_EQ(a.value(2), 0);
|
||||||
|
BOOST_TEST_EQ(a.value(3), 1);
|
||||||
|
BOOST_TEST_EQ(a.value(4), 2);
|
||||||
BOOST_TEST_EQ(a.bin(-1).lower(), -std::numeric_limits<double>::infinity());
|
BOOST_TEST_EQ(a.bin(-1).lower(), -std::numeric_limits<double>::infinity());
|
||||||
|
BOOST_TEST_EQ(a.bin(-1).upper(), -2);
|
||||||
|
BOOST_TEST_EQ(a.bin(a.size()).lower(), 2);
|
||||||
BOOST_TEST_EQ(a.bin(a.size()).upper(), std::numeric_limits<double>::infinity());
|
BOOST_TEST_EQ(a.bin(a.size()).upper(), std::numeric_limits<double>::infinity());
|
||||||
BOOST_TEST_EQ(a.index(-10.), -1);
|
BOOST_TEST_EQ(a.index(-10.), -1);
|
||||||
BOOST_TEST_EQ(a.index(-2.1), -1);
|
BOOST_TEST_EQ(a.index(-2.1), -1);
|
||||||
@ -62,6 +71,9 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(-std::numeric_limits<double>::infinity()), -1);
|
BOOST_TEST_EQ(a.index(-std::numeric_limits<double>::infinity()), -1);
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 4);
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 4);
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 4);
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 4);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a),
|
||||||
|
"regular(4, -2, 2, metadata=\"bar\", options=underflow | overflow)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// with inverted range
|
// with inverted range
|
||||||
@ -102,6 +114,8 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
||||||
|
|
||||||
BOOST_TEST_THROWS((axis::regular<double, tr::log>{2, -1, 0}), std::invalid_argument);
|
BOOST_TEST_THROWS((axis::regular<double, tr::log>{2, -1, 0}), std::invalid_argument);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "regular_log(2, 1, 100, options=underflow | overflow)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// with sqrt transform
|
// with sqrt transform
|
||||||
@ -122,6 +136,8 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(4), 2);
|
BOOST_TEST_EQ(a.index(4), 2);
|
||||||
BOOST_TEST_EQ(a.index(100), 2);
|
BOOST_TEST_EQ(a.index(100), 2);
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "regular_sqrt(2, 0, 4, options=underflow | overflow)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// with pow transform
|
// with pow transform
|
||||||
@ -142,6 +158,9 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.index(4), 2);
|
BOOST_TEST_EQ(a.index(4), 2);
|
||||||
BOOST_TEST_EQ(a.index(100), 2);
|
BOOST_TEST_EQ(a.index(100), 2);
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a),
|
||||||
|
"regular_pow(2, 0, 4, options=underflow | overflow, power=0.5)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// with step
|
// with step
|
||||||
@ -221,6 +240,12 @@ int main() {
|
|||||||
test(a.bin(0), "[0, 0.5)");
|
test(a.bin(0), "[0, 0.5)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// null_type streamable
|
||||||
|
{
|
||||||
|
auto a = axis::regular<float, def, axis::null_type>(2, 0, 1);
|
||||||
|
BOOST_TEST_EQ(detail::cat(a), "regular(2, 0, 1, options=underflow | overflow)");
|
||||||
|
}
|
||||||
|
|
||||||
// shrink and rebin
|
// shrink and rebin
|
||||||
{
|
{
|
||||||
using A = axis::regular<>;
|
using A = axis::regular<>;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <boost/histogram/axis.hpp>
|
#include <boost/histogram/axis.hpp>
|
||||||
#include <boost/histogram/axis/traits.hpp>
|
#include <boost/histogram/axis/traits.hpp>
|
||||||
#include <boost/mp11.hpp>
|
#include <boost/mp11.hpp>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
|
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/axis/ostream.hpp>
|
#include <boost/histogram/axis/ostream.hpp>
|
||||||
#include <boost/histogram/axis/variable.hpp>
|
#include <boost/histogram/axis/variable.hpp>
|
||||||
|
#include <boost/histogram/detail/cat.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "is_close.hpp"
|
#include "is_close.hpp"
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
|
|
||||||
@ -42,6 +44,18 @@ int main() {
|
|||||||
BOOST_TEST_EQ(a.value(1), 0);
|
BOOST_TEST_EQ(a.value(1), 0);
|
||||||
BOOST_TEST_EQ(a.value(1.5), 0.5);
|
BOOST_TEST_EQ(a.value(1.5), 0.5);
|
||||||
BOOST_TEST_EQ(a.value(2), 1);
|
BOOST_TEST_EQ(a.value(2), 1);
|
||||||
|
BOOST_TEST_EQ(a.index(-10), -1);
|
||||||
|
BOOST_TEST_EQ(a.index(-1), 0);
|
||||||
|
BOOST_TEST_EQ(a.index(0), 1);
|
||||||
|
BOOST_TEST_EQ(a.index(1), 2);
|
||||||
|
BOOST_TEST_EQ(a.index(10), 2);
|
||||||
|
BOOST_TEST_EQ(a.index(-std::numeric_limits<double>::infinity()), -1);
|
||||||
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
||||||
|
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 2);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(detail::cat(a),
|
||||||
|
"variable(-1, 0, 1, metadata=\"bar\", options=underflow | overflow)");
|
||||||
|
|
||||||
axis::variable<> b;
|
axis::variable<> b;
|
||||||
BOOST_TEST_NE(a, b);
|
BOOST_TEST_NE(a, b);
|
||||||
b = a;
|
b = a;
|
||||||
@ -54,14 +68,6 @@ int main() {
|
|||||||
BOOST_TEST_EQ(d, a);
|
BOOST_TEST_EQ(d, a);
|
||||||
axis::variable<> e{-2, 0, 2};
|
axis::variable<> e{-2, 0, 2};
|
||||||
BOOST_TEST_NE(a, e);
|
BOOST_TEST_NE(a, e);
|
||||||
BOOST_TEST_EQ(a.index(-10), -1);
|
|
||||||
BOOST_TEST_EQ(a.index(-1), 0);
|
|
||||||
BOOST_TEST_EQ(a.index(0), 1);
|
|
||||||
BOOST_TEST_EQ(a.index(1), 2);
|
|
||||||
BOOST_TEST_EQ(a.index(10), 2);
|
|
||||||
BOOST_TEST_EQ(a.index(-std::numeric_limits<double>::infinity()), -1);
|
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::infinity()), 2);
|
|
||||||
BOOST_TEST_EQ(a.index(std::numeric_limits<double>::quiet_NaN()), 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// axis::variable circular
|
// axis::variable circular
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
namespace tr = axis::transform;
|
namespace tr = axis::transform;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/args_type.hpp>
|
#include <boost/histogram/detail/args_type.hpp>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/compressed_pair.hpp>
|
#include <boost/histogram/detail/compressed_pair.hpp>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/convert_integer.hpp>
|
#include <boost/histogram/detail/convert_integer.hpp>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_allocator.hpp"
|
#include "utility_allocator.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
|
|
||||||
// See http://www.boost.org for most recent version including documentation.
|
// See http://www.boost.org for most recent version including documentation.
|
||||||
|
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/detect.hpp>
|
#include <boost/histogram/detail/detect.hpp>
|
||||||
#include <boost/histogram/detail/iterator_adaptor.hpp>
|
#include <boost/histogram/detail/iterator_adaptor.hpp>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "utility_iterator.hpp"
|
#include "utility_iterator.hpp"
|
||||||
#include "utility_meta.hpp"
|
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_allocator.hpp"
|
#include "utility_allocator.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include <boost/histogram/literals.hpp>
|
#include <boost/histogram/literals.hpp>
|
||||||
#include <boost/histogram/storage_adaptor.hpp>
|
#include <boost/histogram/storage_adaptor.hpp>
|
||||||
#include <boost/histogram/unlimited_storage.hpp>
|
#include <boost/histogram/unlimited_storage.hpp>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
using namespace boost::histogram::literals;
|
using namespace boost::histogram::literals;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/relaxed_equal.hpp>
|
#include <boost/histogram/detail/relaxed_equal.hpp>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <boost/histogram/detail/replace_default.hpp>
|
#include <boost/histogram/detail/replace_default.hpp>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/detail/tuple_slice.hpp>
|
#include <boost/histogram/detail/tuple_slice.hpp>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram::detail;
|
using namespace boost::histogram::detail;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_histogram.hpp"
|
#include "utility_histogram.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
#include "throw_exception.hpp"
|
#include "throw_exception.hpp"
|
||||||
#include "utility_histogram.hpp"
|
#include "utility_histogram.hpp"
|
||||||
#include "utility_meta.hpp"
|
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "utility_allocator.hpp"
|
#include "utility_allocator.hpp"
|
||||||
#include "utility_axis.hpp"
|
#include "utility_axis.hpp"
|
||||||
#include "utility_histogram.hpp"
|
#include "utility_histogram.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
using namespace boost::histogram::literals; // to get _c suffix
|
using namespace boost::histogram::literals; // to get _c suffix
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
// Copyright 2018 Hans Dembinski
|
// Copyright 2018-2019 Hans Dembinski
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// (See accompanying file LICENSE_1_0.txt
|
// (See accompanying file LICENSE_1_0.txt
|
||||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#ifndef BOOST_HISTOGRAM_TEST_UTILITY_META_HPP
|
#ifndef BOOST_HISTOGRAM_TEST_STD_OSTREAM_HPP
|
||||||
#define BOOST_HISTOGRAM_TEST_UTILITY_META_HPP
|
#define BOOST_HISTOGRAM_TEST_STD_OSTREAM_HPP
|
||||||
|
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
|
||||||
#include <boost/mp11/tuple.hpp>
|
#include <boost/mp11/tuple.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <utility>
|
#include <utility>
|
@ -7,7 +7,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include "throw_exception.hpp"
|
|
||||||
#include <boost/histogram/storage_adaptor.hpp>
|
#include <boost/histogram/storage_adaptor.hpp>
|
||||||
#include <boost/histogram/unlimited_storage.hpp>
|
#include <boost/histogram/unlimited_storage.hpp>
|
||||||
#include <boost/histogram/unsafe_access.hpp>
|
#include <boost/histogram/unsafe_access.hpp>
|
||||||
@ -17,8 +16,9 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "std_ostream.hpp"
|
||||||
|
#include "throw_exception.hpp"
|
||||||
#include "utility_allocator.hpp"
|
#include "utility_allocator.hpp"
|
||||||
#include "utility_meta.hpp"
|
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
@ -265,12 +265,14 @@ int main() {
|
|||||||
BOOST_TEST(lt(1, 2.0));
|
BOOST_TEST(lt(1, 2.0));
|
||||||
BOOST_TEST(lt(-1.0, 1u));
|
BOOST_TEST(lt(-1.0, 1u));
|
||||||
BOOST_TEST(lt(1u, 2.0));
|
BOOST_TEST(lt(1u, 2.0));
|
||||||
|
BOOST_TEST(lt(1.0, 2.0));
|
||||||
BOOST_TEST_NOT(lt(1u, 1));
|
BOOST_TEST_NOT(lt(1u, 1));
|
||||||
BOOST_TEST_NOT(lt(1, 1u));
|
BOOST_TEST_NOT(lt(1, 1u));
|
||||||
BOOST_TEST_NOT(lt(1.0, 1));
|
BOOST_TEST_NOT(lt(1.0, 1));
|
||||||
BOOST_TEST_NOT(lt(1, 1.0));
|
BOOST_TEST_NOT(lt(1, 1.0));
|
||||||
BOOST_TEST_NOT(lt(1.0, 1u));
|
BOOST_TEST_NOT(lt(1.0, 1u));
|
||||||
BOOST_TEST_NOT(lt(1u, 1.0));
|
BOOST_TEST_NOT(lt(1u, 1.0));
|
||||||
|
BOOST_TEST_NOT(lt(1.0, 1.0));
|
||||||
|
|
||||||
auto gt = detail::greater{};
|
auto gt = detail::greater{};
|
||||||
BOOST_TEST(gt(2u, 1u));
|
BOOST_TEST(gt(2u, 1u));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2018 Hans Dembinski
|
// Copyright 2018-2019 Hans Dembinski
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// (See accompanying file LICENSE_1_0.txt
|
// (See accompanying file LICENSE_1_0.txt
|
||||||
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/histogram/fwd.hpp>
|
#include <boost/histogram/fwd.hpp>
|
||||||
#include "utility_meta.hpp"
|
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace histogram {
|
namespace histogram {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "utility_allocator.hpp"
|
#include "utility_allocator.hpp"
|
||||||
#include "utility_meta.hpp"
|
#include "std_ostream.hpp"
|
||||||
|
|
||||||
using namespace boost::histogram;
|
using namespace boost::histogram;
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ LCOV="${LCOV_DIR}/bin/lcov --gcov-tool=${GCOV}" # no branch coverage
|
|||||||
# collect raw data
|
# collect raw data
|
||||||
$LCOV --base-directory `pwd` \
|
$LCOV --base-directory `pwd` \
|
||||||
--directory `pwd`/../../bin.v2/libs/histogram/test \
|
--directory `pwd`/../../bin.v2/libs/histogram/test \
|
||||||
--directory `pwd`/../../bin.v2/libs/histogram/examples \
|
|
||||||
--capture --output-file coverage.info
|
--capture --output-file coverage.info
|
||||||
|
|
||||||
# remove uninteresting entries
|
# remove uninteresting entries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user