|
Boost-Commit : |
From: dave_at_[hidden]
Date: 2007-11-12 20:36:08
Author: dave
Date: 2007-11-12 20:36:08 EST (Mon, 12 Nov 2007)
New Revision: 41051
URL: http://svn.boost.org/trac/boost/changeset/41051
Log:
process_jam_log: flush warning message before asserting
recipe.py:
account for algorithm/minmax and algorithm/string
always check out HEAD (for testing purposes)
always remove bjam.log before running bjam
add --reflect-test-status so bitten will show all failures
regression.py:
add --reflect-test-status so bitten will show all failures
use try...finally for changes to working directory
log current directory where commands are executed
Text files modified:
branches/bitten/tools/regression/src/process_jam_log.cpp | 2 +-
branches/bitten/tools/regression/src/recipe.py | 15 ++++++++++++---
branches/bitten/tools/regression/src/regression.py | 34 +++++++++++++++++++++++++---------
3 files changed, 38 insertions(+), 13 deletions(-)
Modified: branches/bitten/tools/regression/src/process_jam_log.cpp
==============================================================================
--- branches/bitten/tools/regression/src/process_jam_log.cpp (original)
+++ branches/bitten/tools/regression/src/process_jam_log.cpp 2007-11-12 20:36:08 EST (Mon, 12 Nov 2007)
@@ -374,7 +374,7 @@
if ( !file )
{
std::cout << "*****Warning - can't open output file: "
- << pth.string() << "\n";
+ << pth.string() << "\n" << std::flush;
assert( file );
}
else xml::write( *m_root, file );
Modified: branches/bitten/tools/regression/src/recipe.py
==============================================================================
--- branches/bitten/tools/regression/src/recipe.py (original)
+++ branches/bitten/tools/regression/src/recipe.py 2007-11-12 20:36:08 EST (Mon, 12 Nov 2007)
@@ -3,9 +3,14 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# This was output by "bjam -n --boost-dependency-info"
+#
+# algorithm library doesn't meet the test directory protocol, so entered
+# algorithm/minmax and algorithm/string by hand.
+
dependencies = '''test:
config:
-algorithm: regex
+algorithm/minmax: regex
+algorithm/string: regex
regex: thread program_options
date_time: serialization
system:
@@ -131,7 +136,10 @@
xmlns:python="http://bitten.cmlenz.net/tools/python"
>
<step id="get-tool-source" description="Update tools source code to version being tested">
- <sh:exec executable="rm" args="-f results/bjam.log" />
+ <svn:checkout
+ dir_="tools"
+ url="%(repo)s/tools"
+ revision="HEAD" />
<svn:checkout
dir_="tools_regression"
url="%(repo)s/tools/regression"
@@ -153,7 +161,8 @@
'''
lib ='''
<step id="%(libname)s" description="Tests for %(libname)s">
- <python:exec file="run.py" args="--incremental --library=%(libname)s --debug-level=10 --bjam-options=-j${boost.parallelism} ${boost.lib-build-options} --bitten-report=results/%(libname)s.xml setup test-run test-process create-bitten-report" />
+ <sh:exec executable="rm" args="-f results/bjam.log" />
+ <python:exec file="run.py" args="--incremental --library=%(libname)s --debug-level=10 --bjam-options=-j${boost.parallelism} ${boost.lib-build-options} --reflect-test-status --bitten-report=results/%(libname)s.xml test-run test-process create-bitten-report" />
<report category="test" file="results/%(libname)s.xml" />
</step>
'''
Modified: branches/bitten/tools/regression/src/regression.py
==============================================================================
--- branches/bitten/tools/regression/src/regression.py (original)
+++ branches/bitten/tools/regression/src/regression.py 2007-11-12 20:36:08 EST (Mon, 12 Nov 2007)
@@ -71,6 +71,10 @@
help="bootstrap toolset for 'process_jam_log' executable" )
opt.add_option( '--platform' )
+ opt.add_option( '--reflect-test-status',
+ help="if a test fails, exit with a nonzero status",
+ action='store_true' )
+
#~ Source Options:
opt.add_option( '--user',
help="Boost SVN user ID" )
@@ -134,6 +138,8 @@
self.mail=None
self.smtp_login=None
self.skip_tests=False
+ self.exit_code=0
+ self.reflect_test_status=False
( _opt_, self.actions ) = opt.parse_args(None,self)
if not self.actions or self.actions == []:
self.actions = [ 'regression' ]
@@ -310,22 +316,29 @@
os.chdir( os.path.join( self.boost_root, 'libs', self.library, 'test' ) )
else:
os.chdir( os.path.join( self.boost_root, 'status' ) )
- self.log( '...in (%s).' % os.getcwd() )
- self._system( [ test_cmd ] )
- os.chdir( cd )
+
+ try:
+ self.log( '...in (%s).' % os.getcwd() )
+
+ exit_code = self._system( [ test_cmd ] )
+ self.exit_code = self.exit_code or exit_code
+ finally:
+ os.chdir( cd )
def command_test_process(self):
self.import_utils()
self.log( 'Getting test case results out of "%s"...' % self.regression_log )
cd = os.getcwd()
os.chdir( os.path.join( self.boost_root, 'status' ) )
- self._checked_system( [
- '"%s" "%s" <"%s"' % (
+ try:
+ self._checked_system( [
+ '"%s" "%s" <"%s"' % (
self.tool_path(self.process_jam_log),
self.regression_results,
self.regression_log )
- ] )
- os.chdir( cd )
+ ] )
+ finally:
+ os.chdir( cd )
def command_collect_logs(self):
self.import_utils()
@@ -479,6 +492,9 @@
action_m = "command_"+action.replace('-','_')
if hasattr(self,action_m):
getattr(self,action_m)()
+
+ if self.exit_code != 0 and self.reflect_test_status:
+ sys.exit(self.exit_code)
def platform_name(self):
# See http://article.gmane.org/gmane.comp.lib.boost.testing/933
@@ -606,11 +622,11 @@
) )
def _system( self, cmds ):
- self.log('running system commands: %s' % cmds)
+ self.log('running system commands in %s: %s' % (os.getcwd(), cmds))
utils.system( cmds )
def _checked_system( self, cmds ):
- self.log('running checked system commands: %s' % cmds)
+ self.log('running checked system commands in %s: %s' % (os.getcwd(), cmds))
utils.checked_system( cmds )
def bjam_build_cmd( self, *rest ):
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