From: g0dil Date: Fri, 13 Nov 2009 10:15:36 +0000 (+0000) Subject: Scheduler: Add missing SENF_TIMING_CRITICAL_TESTS guard X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=a46724f6a51d4b14a2170976405530d0f5aef590;p=senf.git Scheduler: Add missing SENF_TIMING_CRITICAL_TESTS guard git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1523 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Scheduler/TimerEvent.test.cc b/senf/Scheduler/TimerEvent.test.cc index 1d3b815..5843eae 100644 --- a/senf/Scheduler/TimerEvent.test.cc +++ b/senf/Scheduler/TimerEvent.test.cc @@ -55,6 +55,9 @@ namespace { BOOST_AUTO_UNIT_TEST(timerDispatcher) { + char const * enabled (getenv("SENF_TIMING_CRITICAL_TESTS")); + BOOST_WARN_MESSAGE(enabled, "Set SENF_TIMING_CRITICAL_TESTS to not skip timing critical tests"); + senf::scheduler::detail::FdManager::instance().timeout(1000); senf::ClockService::clock_type t (senf::ClockService::now()); @@ -68,7 +71,8 @@ BOOST_AUTO_UNIT_TEST(timerDispatcher) senf::ClockService::clock_type t2 (senf::ClockService::now()); BOOST_CHECK( called ); BOOST_CHECK( ! timer.enabled() ); - BOOST_CHECK_PREDICATE( is_close, (t2-t)(senf::ClockService::milliseconds(500)) ); + if (enabled) + BOOST_CHECK_PREDICATE( is_close, (t2-t)(senf::ClockService::milliseconds(500)) ); called=false; t = senf::ClockService::now(); @@ -80,7 +84,8 @@ BOOST_AUTO_UNIT_TEST(timerDispatcher) SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().prepareRun() ); SENF_CHECK_NO_THROW( senf::scheduler::detail::FIFORunner::instance().run() ); SENF_CHECK_NO_THROW( senf::scheduler::detail::TimerDispatcher::instance().disable() ); - BOOST_CHECK_PREDICATE( is_close, (t) (senf::ClockService::now()) ); + if (enabled) + BOOST_CHECK_PREDICATE( is_close, (t) (senf::ClockService::now()) ); BOOST_CHECK( called ); } }