From: g0dil Date: Fri, 18 Sep 2009 11:54:32 +0000 (+0000) Subject: Add SENF_TIMING_CRITICAL_TESTS environment flag X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=c2f0215635980462481417204f27e27e4b4f702f;p=senf.git Add SENF_TIMING_CRITICAL_TESTS environment flag git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1424 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index dd029f1..60683ef 100644 --- a/SConstruct +++ b/SConstruct @@ -190,14 +190,14 @@ if env.GetOption('clean'): env.Clean('all', ('.prepare-stamp', env.Dir('dist'))) if env.GetOption('clean') : env.Depends('all', ('lcov', 'all_valgrinds')) -if env.GetOption('clean'): +if env.GetOption('clean') and 'all' in BUILD_TARGETS: env.Clean('all', [ os.path.join(path,f) for path, subdirs, files in os.walk('.') for pattern in env['CLEAN_PATTERNS'] for f in fnmatch.filter(files,pattern) ]) - if 'all' in BUILD_TARGETS: - import SCons.SConsign - SCons.SConsign.write = lambda : None + # Disable writing to the deleted .sconsign file + import SCons.SConsign + SCons.SConsign.write = lambda : None if not env.GetOption('clean') and not os.path.exists(".prepare-stamp"): Execute(Touch(".prepare-stamp")) diff --git a/senf/PPI/RateAnalyzer.test.cc b/senf/PPI/RateAnalyzer.test.cc index c5ac146..fbc1d50 100644 --- a/senf/PPI/RateAnalyzer.test.cc +++ b/senf/PPI/RateAnalyzer.test.cc @@ -74,6 +74,10 @@ namespace { BOOST_AUTO_UNIT_TEST(rateAnalyzer) { + char const * enabled (getenv("SENF_TIMING_CRITICAL_TESTS")); + if (! enabled) { + BOOST_WARN_MESSAGE(false, "Set SENF_TIMING_CRITICAL_TESTS to not skip timing critical tests"); + } senf::DataPacket p (senf::DataPacket::create(13u)); senf::ppi::module::CloneSource source (p); senf::ppi::module::RateFilter filter (senf::ClockService::milliseconds(58u)); @@ -93,8 +97,10 @@ BOOST_AUTO_UNIT_TEST(rateAnalyzer) pps /= calls; bps /= calls; - BOOST_CHECK_CLOSE( pps, 16.67f, .1f ); - BOOST_CHECK_CLOSE( bps, 216.67f, .1f ); + if (enabled) { + BOOST_CHECK_CLOSE( pps, 16.67f, .1f ); + BOOST_CHECK_CLOSE( bps, 216.67f, .1f ); + } } ///////////////////////////////cc.e////////////////////////////////////////