- Make sure testsuite works with "exception-handling=off"

This commit is contained in:
Ion Gaztañaga
2020-10-23 14:14:15 +02:00
parent e490e50192
commit 525b46055e
10 changed files with 68 additions and 65 deletions

View File

@ -21,7 +21,7 @@ rule test_all
for local fileb in [ glob *.cpp ]
{
all_rules += [ run $(fileb) /boost/container//boost_container /boost/timer//boost_timer
all_rules += [ run $(fileb) /boost/container//boost_container
: # additional args
: # test-files
: # requirements

View File

@ -29,10 +29,11 @@
#include <cstddef> //std::size_t
#include <cassert> //assert
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
#include <boost/move/detail/nsec_clock.hpp>
using boost::move_detail::cpu_timer;
using boost::move_detail::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;

View File

@ -22,10 +22,10 @@
#include <typeinfo> //typeid
#include <cassert> //assert
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
#include <boost/move/detail/nsec_clock.hpp>
using boost::move_detail::cpu_timer;
using boost::move_detail::cpu_times;
using boost::move_detail::nanosecond_type;
using namespace boost::container;

View File

@ -22,10 +22,10 @@
#include <iostream> //std::cout, std::endl
#include <cassert> //assert
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
#include <boost/move/detail/nsec_clock.hpp>
using boost::move_detail::cpu_timer;
using boost::move_detail::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;

View File

@ -23,11 +23,11 @@
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <cstring> //std::strcmp
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include <typeinfo>
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::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;

View File

@ -24,10 +24,10 @@
#include <iostream> //std::cout, std::endl
#include <cassert> //assert
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
#include <boost/move/detail/nsec_clock.hpp>
using boost::move_detail::cpu_timer;
using boost::move_detail::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;

View File

@ -26,11 +26,11 @@
#include <boost/container/adaptive_pool.hpp>
#include <boost/container/stable_vector.hpp>
#include <boost/container/vector.hpp>
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.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::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;

View File

@ -12,7 +12,7 @@
#define BOOST_CONTAINER_BENCH_BENCH_SET_HPP
#include <iostream>
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include <algorithm> //sort
#include <exception>
#include <sstream>
@ -21,9 +21,9 @@
#include <boost/container/string.hpp>
#include <boost/core/no_exceptions_support.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::cpu_times;
using boost::move_detail::nanosecond_type;
#define SIMPLE_IT
#ifdef SIMPLE_IT
@ -39,9 +39,9 @@ static const std::size_t NIter = 3;
static const std::size_t NElements = 1000;
void compare_times(cpu_times time_numerator, cpu_times time_denominator){
std::cout << ((double)time_numerator.wall/(double)time_denominator.wall) << std::endl;
std::cout << "----------------------------------------------" << '\n' << std::endl;
void compare_times(cpu_times time_numerator, cpu_times time_denominator)
{
std::cout << ((double)time_numerator.wall/(double)time_denominator.wall) << '\n' << std::endl;
}
template< class RandomIt >
@ -183,10 +183,10 @@ cpu_times copy_destroy_time(boost::container::vector<typename C::value_type> &un
}
total_time.stop();
std::cout << " Copy sorted range " << boost::timer::format(copy_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Assign sorted range " << boost::timer::format(assign_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Destroy " << boost::timer::format(destroy_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Total time = " << boost::timer::format(total_time.elapsed(), boost::timer::default_places, "%ws\n") << std::endl;
std::cout << " Copy sorted range " << double(copy_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Assign sorted range " << double(assign_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Destroy " << double(destroy_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Total time = " << double(total_time.elapsed().wall)/double(1000000000) << "s\n";
return total_time.elapsed();
}
@ -216,9 +216,9 @@ cpu_times construct_time( boost::container::vector<typename C::value_type> &uniq
}
}
std::cout << " Construct " << RangeType << " unique_range " << boost::timer::format(sur_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Construct " << RangeType << " range " << boost::timer::format(sr_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Total time = " << boost::timer::format(total_time.elapsed(), boost::timer::default_places, "%ws\n") << std::endl;
std::cout << " Construct " << RangeType << " unique_range " << double(sur_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Construct " << RangeType << " range " << double(sr_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Total time = " << double(total_time.elapsed().wall)/double(1000000000) << "s\n";
return total_time.elapsed();
}
@ -252,9 +252,9 @@ cpu_times insert_time( boost::container::vector<typename C::value_type> &unique_
}
}
std::cout << " Insert " << RangeType << " unique_range " << boost::timer::format(ur_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Insert " << RangeType << " range " << boost::timer::format(r_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Total time = " << boost::timer::format(total_time.elapsed(), boost::timer::default_places, "%ws\n") << std::endl;
std::cout << " Insert " << RangeType << " unique_range " << double(ur_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Insert " << RangeType << " range " << double(r_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Total time = " << double(total_time.elapsed().wall)/double(1000000000) << "s\n";
return total_time.elapsed();
}
@ -357,12 +357,12 @@ cpu_times search_time(boost::container::vector<typename C::value_type> &unique_r
}
total_time.stop();
std::cout << " Find " << RangeType << " " << boost::timer::format(find_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Lower Bound " << RangeType << " " << boost::timer::format(lower_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Upper Bound " << RangeType << " " << boost::timer::format(upper_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Equal Range " << RangeType << " " << boost::timer::format(equal_range_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Count " << RangeType << " " << boost::timer::format(count_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Total time = " << boost::timer::format(total_time.elapsed(), boost::timer::default_places, "%ws\n") << std::endl;
std::cout << " Find " << RangeType << " " << double(find_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Lower Bound " << RangeType << " " << double(lower_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Upper Bound " << RangeType << " " << double(upper_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Equal Range " << RangeType << " " << double(equal_range_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Count " << RangeType << " " << double(count_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Total time = " << double(total_time.elapsed().wall)/double(1000000000) << "s\n";
return total_time.elapsed();
}
@ -385,8 +385,8 @@ void extensions_time(boost::container::vector<typename C::value_type> &sorted_un
}
}
std::cout << " Construct sorted_unique_range " << boost::timer::format(sur_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Construct sorted_unique_range (extension) " << boost::timer::format(sur_opt_timer.elapsed(), boost::timer::default_places, "%ws\n");
std::cout << " Construct sorted_unique_range " << double(sur_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Construct sorted_unique_range (extension) " << double(sur_opt_timer.elapsed().wall)/double(1000000000) << "s\n";
std::cout << "Extension/Standard: ";
compare_times(sur_opt_timer.elapsed(), sur_timer.elapsed());
}
@ -396,6 +396,7 @@ void launch_tests(const char *BoostContName, const char *StdContName)
{
typedef range_provider<typename BoostClass::value_type> get_range_t;
std::cout << std::fixed << std::setw( 11 );
std::cout << "**********************************************" << '\n';
std::cout << "**********************************************" << '\n';
std::cout << '\n';

View File

@ -21,13 +21,14 @@
#include "../test/movable_int.hpp"
#include <vector>
#include <iostream>
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include <algorithm>
#include <exception>
#include <iomanip>
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::cpu_times;
using boost::move_detail::nanosecond_type;
static const std::size_t N = 500;
@ -100,18 +101,18 @@ cpu_times time_it()
destructionTime.stop();
}
totalTime.stop();
std::cout << " construction took " << boost::timer::format(constructTime.elapsed(), 6, "%ws wall, %ts CPU (%p%)\n");
std::cout << " sort took " << boost::timer::format(sortTime.elapsed(), 6, "%ws wall, %ts CPU (%p%)\n");
std::cout << " rotate took " << boost::timer::format(rotateTime.elapsed(), 6, "%ws wall, %ts CPU (%p%)\n");
std::cout << " destruction took " << boost::timer::format(destructionTime.elapsed(), 6, "%ws wall, %ts CPU (%p%)\n");
std::cout << " Total time = " << boost::timer::format(totalTime.elapsed(), 6, "%ws wall, %ts CPU (%p%)\n") << std::endl;
std::cout << std::fixed << std::setw( 11 );
std::cout << " construction took " << double(constructTime.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " sort took " << double(sortTime.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " rotate took " << double(rotateTime.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " destruction took " << double(destructionTime.elapsed().wall)/double(1000000000) << "s\n";
std::cout << " Total time = " << double(totalTime.elapsed().wall)/double(1000000000) << "s\n";
return totalTime.elapsed();
}
void compare_times(cpu_times time_numerator, cpu_times time_denominator){
std::cout
<< "\n wall = " << ((double)time_numerator.wall/(double)time_denominator.wall)
<< "\n (user+sys) = " << ((double)(time_numerator.system+time_numerator.user)/(double)(time_denominator.system+time_denominator.user)) << "\n\n";
<< "\n wall = " << ((double)time_numerator.wall/(double)time_denominator.wall) << "\n\n";
}
int main()

View File

@ -19,7 +19,7 @@
#include <memory> //std::allocator
#include <iostream> //std::cout, std::endl
#include <cstring> //std::strcmp
#include <boost/timer/timer.hpp>
#include <boost/move/detail/nsec_clock.hpp>
#include <typeinfo>
//capacity
@ -30,9 +30,9 @@
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
#include <boost/intrusive/detail/has_member_function_callable_with.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::cpu_times;
using boost::move_detail::nanosecond_type;
namespace bc = boost::container;