1
0
forked from boostorg/move

- Make sure testsuite passes with "exception-handling=off". Requires using a custom mini-timer since Boost.Timer depends on Boost.Chrono, and Boost.Chrono's dll does not compile without exceptions.

This commit is contained in:
Ion Gaztañaga
2020-10-22 23:12:51 +02:00
parent ac4d3feed1
commit 75eb880a56
7 changed files with 235 additions and 23 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ rule test_all
for local fileb in [ glob *.cpp ]
{
all_rules += [ run $(fileb) /boost/timer//boost_timer
all_rules += [ run $(fileb)
: # additional args
: # test-files
: # requirements
+2 -1
View File
@@ -22,6 +22,7 @@
#include <boost/move/algo/adaptive_merge.hpp>
#include <boost/move/core.hpp>
#include <cstdlib>
template<class T>
@@ -60,7 +61,7 @@ bool test_random_shuffled(std::size_t const element_count, std::size_t const num
if (!is_order_type_ordered(elements.get(), element_count))
{
std::cout << "\n ERROR\n";
throw int(0);
std::abort();
}
}
return true;
+2 -1
View File
@@ -22,6 +22,7 @@
#include <boost/move/algo/adaptive_sort.hpp>
#include <boost/move/core.hpp>
#include <cstdlib>
template<class T>
bool test_random_shuffled(std::size_t const element_count, std::size_t const num_keys, std::size_t const num_iter)
@@ -53,7 +54,7 @@ bool test_random_shuffled(std::size_t const element_count, std::size_t const num
if (!is_order_type_ordered(elements.get(), element_count))
{
std::cout << "\n ERROR\n";
throw int(0);
std::abort();
}
}
return true;
+6 -13
View File
@@ -18,16 +18,16 @@
#include <boost/container/vector.hpp> //boost::container::vector
#include <boost/config.hpp>
#include <cstdlib>
#include <boost/move/unique_ptr.hpp>
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include "order_type.hpp"
#include "random_shuffle.hpp"
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
using boost::move_detail::cpu_timer;
using boost::move_detail::nanosecond_type;
void print_stats(const char *str, boost::ulong_long_type element_count)
{
@@ -255,9 +255,8 @@ bool measure_all(std::size_t L, std::size_t NK)
elements = original_elements;
res = res && measure_algo(elements.data(), L, split_pos,StdInplaceMerge, prev_clock);
//
if(!res)
throw int(0);
if (!res)
std::abort();
return res;
}
@@ -267,7 +266,6 @@ bool measure_all(std::size_t L, std::size_t NK)
int main()
{
try{
#ifndef BENCH_SORT_UNIQUE_VALUES
measure_all<order_perf_type>(101,1);
measure_all<order_perf_type>(101,5);
@@ -324,11 +322,6 @@ int main()
measure_all<order_perf_type>(10000001,0);
#endif //#ifndef BENCH_MERGE_SHORT
#endif //#ifdef NDEBUG
}
catch(...)
{
return 1;
}
return 0;
}
+6 -6
View File
@@ -17,11 +17,11 @@
#include <boost/config.hpp>
#include <boost/move/unique_ptr.hpp>
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include <cstdlib>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
using boost::move_detail::cpu_timer;
using boost::move_detail::nanosecond_type;
#include "order_type.hpp"
#include "random_shuffle.hpp"
@@ -304,9 +304,9 @@ bool measure_all(std::size_t L, std::size_t NK)
//prev_clock = back_clock;
//elements = original_elements;
//res = res && measure_algo(elements.data(), L,SlowStableSort, prev_clock);
//
if(!res)
throw int(0);
std::abort();
return res;
}