|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74632 - in trunk/libs/chrono/test: . stopwatch
From: vicente.botet_at_[hidden]
Date: 2011-10-01 17:26:48
Author: viboes
Date: 2011-10-01 17:26:47 EDT (Sat, 01 Oct 2011)
New Revision: 74632
URL: http://svn.boost.org/trac/boost/changeset/74632
Log:
Chrono: remove not useful lightweight_stopwatch_reporter
Removed:
trunk/libs/chrono/test/stopwatch/simple_lightweight_stopwatch_reporter_pass.cpp
Text files modified:
trunk/libs/chrono/test/Jamfile.v2 | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
Modified: trunk/libs/chrono/test/Jamfile.v2
==============================================================================
--- trunk/libs/chrono/test/Jamfile.v2 (original)
+++ trunk/libs/chrono/test/Jamfile.v2 2011-10-01 17:26:47 EDT (Sat, 01 Oct 2011)
@@ -247,7 +247,7 @@
[ chrono-run2 stopwatch/basic_stopwatch_pass.cpp : basic_stopwatch_pass ]
[ chrono-run2 stopwatch/basic_stopwatch_last_lap_pass.cpp : basic_stopwatch_last_lap_pass ]
[ chrono-run2 stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp : basic_stopwatch_laps_accumulator_set_pass ]
- [ chrono-run2 stopwatch/basic_stopwatch_laps_container_pass.cpp : basic_stopwatch_laps_container_pass ]
+ [ chrono-run2 stopwatch/basic_stopwatch_laps_container_pass.cpp : basic_stopwatch_laps_accumulator_set_pass ]
[ chrono-run2 stopwatch/suspendable_stopwatch_pass.cpp : suspendable_stopwatch_pass ]
;
@@ -259,11 +259,9 @@
test-suite "stopclock"
:
[ chrono-run2-mt stopwatch/simple_stopwatch_reporter_pass.cpp : simple_stopwatch_reporter_pass ]
- [ chrono-run2-mt stopwatch/simple_lightweight_stopwatch_reporter_pass.cpp : simple_lightweight_stopwatch_reporter_pass ]
;
test-suite "stopclock_ex"
:
- [ chrono-run2-mt ../example/lightweight_stopwatch_reporter_example.cpp : lightweight_stopwatch_reporter_example ]
[ chrono-run2-mt ../example/stopwatch_reporter_example.cpp : stopwatch_reporter_example ]
;
Deleted: trunk/libs/chrono/test/stopwatch/simple_lightweight_stopwatch_reporter_pass.cpp
==============================================================================
--- trunk/libs/chrono/test/stopwatch/simple_lightweight_stopwatch_reporter_pass.cpp 2011-10-01 17:26:47 EDT (Sat, 01 Oct 2011)
+++ (empty file)
@@ -1,133 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// Adaptation to Boost of the libcxx
-// Copyright 2010 Vicente J. Botet Escriba
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-#include <iostream>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/chrono/stopwatches/simple_stopwatch.hpp>
-#include <libs/chrono/test/cycle_count.hpp>
-#include <boost/chrono/stopwatches/reporters/lightweight_stopwatch_reporter.hpp>
-#include <boost/chrono/chrono_io.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/chrono/stopwatches/reporters/system_default_formatter.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#if !defined(BOOST_NO_STATIC_ASSERT)
-#define NOTHING ""
-#endif
-
-using namespace boost::chrono;
-
-
-template <typename Reporter>
-void check_invariants()
-{
- typedef Reporter Stopwatch;
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Stopwatch::rep, typename Stopwatch::clock::duration::rep>::value), NOTHING, ());
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Stopwatch::period, typename Stopwatch::clock::duration::period>::value), NOTHING, ());
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Stopwatch::duration, typename Stopwatch::clock::time_point::duration>::value), NOTHING, ());
- BOOST_CHRONO_STATIC_ASSERT(Stopwatch::is_steady == Stopwatch::clock::is_steady, NOTHING, ());
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Stopwatch::stopwatch, simple_stopwatch<typename Stopwatch::clock> >::value), NOTHING, ());
-}
-
-template <typename Reporter>
-void check_constructor()
-{
- static typename Reporter::formatter_type fmtr;
-
- Reporter _(fmtr);
-}
-
-template <typename Reporter>
-void check_constructor_ec()
-{
- static typename Reporter::formatter_type fmtr;
-
- boost::system::error_code ec;
- Reporter _(fmtr, ec);
- BOOST_TEST(ec.value()==0);
-}
-
-template <typename Reporter>
-void check_constructor_throws()
-{
- static typename Reporter::formatter_type fmtr;
-
- Reporter _(fmtr, boost::throws());
-}
-
-template <typename Reporter>
-void check_elapsed(bool check=true)
-{
- static typename Reporter::formatter_type fmtr;
-
- Reporter sw(fmtr);
- ex::sleep_for<typename Reporter::clock>(milliseconds(100));
- typename Reporter::duration d=sw.elapsed();
- std::cout << d << std::endl;
- if (check)
- BOOST_TEST(d >= milliseconds(100));
-}
-
-template <typename Reporter>
-void check_report()
-{
- static typename Reporter::formatter_type fmtr;
-
- Reporter sw(fmtr);
- ex::sleep_for<typename Reporter::clock>(milliseconds(100));
- sw.report();
-}
-
-template <typename Reporter>
-void check_file_line()
-{
- static typename Reporter::formatter_type fmtr("%1%[%2%] Elapsed time: %3%\n");
-
- fmtr % __FILE__ % __LINE__;
-
- Reporter _(fmtr);
- ex::sleep_for<typename Reporter::clock>(milliseconds(100));
-}
-
-template <typename Clock>
-void check_all(bool check=true)
-{
- typedef simple_stopwatch<Clock> Stopwatch;
- typedef typename stopwatch_reporter_default_formatter<Stopwatch>::type Formatter;
- typedef lightweight_stopwatch_reporter<Stopwatch> Reporter;
- typedef elapsed_formatter FormatterE;
- typedef lightweight_stopwatch_reporter<Stopwatch,FormatterE> ReporterE;
-
- check_invariants<Reporter>();
- check_constructor<Reporter>();
- check_constructor_ec<Reporter>();
- check_constructor_throws<Reporter>();
- check_elapsed<Reporter>(check);
- check_report<Reporter>();
- check_file_line<ReporterE>();
-}
-
-int main()
-{
-
- typedef simple_stopwatch<high_resolution_clock > Stopwatch;
- typedef stopwatch_reporter_default_formatter<Stopwatch>::type Formatter;
- typedef lightweight_stopwatch_reporter<Stopwatch> Reporter;
- static Formatter fmtr;
-
- Reporter _(fmtr);
-
- check_all<ex::cycle_count<1500> >(true);
-
- return boost::report_errors();
-}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk