Merge tools/regression from trunk

[SVN r74759]
This commit is contained in:
Beman Dawes 2011-10-06 15:41:40 +00:00
parent b54206b61e
commit d9367fd4eb
6 changed files with 87 additions and 43 deletions

View file

@ -58,9 +58,9 @@
<li>Invoke one of the following:
<ul>
<li><code>../../../tools/regression/library_test (*nix)</code>.</li>
<li><code>../../../tools/regression/src/library_test (*nix)</code>.</li>
<li><code>..\..\..\tools\regression\library_test
<li><code>..\..\..\tools\regression\src\library_test
(windows)</code>.</li>
</ul>
</li>
@ -398,7 +398,7 @@
<p>This table was generated by invoking the following command line:</p>
<p><code>../../../tools/regression/library_test --toolset=msvc-7.1
<p><code>../../../tools/regression/src/library_test --toolset=msvc-7.1
variant=debug,release</code></p>
<p>from within the .../libs/regex/test directory.</p>
@ -442,7 +442,7 @@
command line shells, there is shell script that can be run from the boost
root directory:
<p><code>tools/regression/library_test_all</code></p>
<p><code>tools/regression/src/library_test_all</code></p>
<p>The command line arguments are the same as for running the test for one
library. This script creates all the html files in all the test directories

View file

@ -228,6 +228,34 @@ def copy_comments( results_xml, comment_file ):
f.close()
else:
utils.log( 'Warning: comment file "%s" is not found.' % comment_file )
lines = ['']
for arg in sys.argv:
# Make sure that the ftp details are hidden
arg = re.sub( 'ftp://.*$', 'ftp://XXXXX', arg )
# Escape quotes
arg = re.sub( r'(\\|")', r'\\\1', arg )
# Quote arguments if needed
if arg.find( ' ' ) != -1:
arg = '"%s"' % arg
if len( lines[-1] ) + len( arg ) + 2 >= 80:
# align backslashes
lines[-1] += ' ' * ( 79 - len( lines[-1] ) )
# indent lines after the first
lines.append( ' ' )
lines[-1] += ( arg + ' ' )
results_xml.characters( '<hr>' )
results_xml.characters( '<dl>' )
results_xml.characters( '<dt>Command Line</dt>' )
results_xml.characters( '<dd>' )
results_xml.characters( '<pre>' )
results_xml.characters( '\\\n'.join(lines) )
results_xml.characters( '</pre>' )
results_xml.characters( '</dd>' )
results_xml.characters( '</dl>\n' )
results_xml.endElement( 'comment' )

View file

@ -1,16 +1,17 @@
// Generate Compiler Status HTML from jam regression test output -----------//
// Copyright Bryce Lelbach 2011
// Copyright Beman Dawes 2002-2011.
// Copyright Beman Dawes 2002.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/tools/regression/ for documentation.
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/tools/regression/ for documentation.
/*******************************************************************************
Please contact the maintainer, bdawes <at> acm <dot> org, before making
any non-trivial changes.
This program was designed to work unchanged on all platforms and
configurations. All output which is platform or configuration dependent
is obtained from external sources such as the .xml file from
@ -197,11 +198,11 @@ namespace
if ( !fs::exists( dir_path ) ) return false;
for ( fs::directory_iterator itr( dir_path ); itr != end_itr; ++itr )
if ( fs::is_directory( *itr )
&& itr->path().string() != ignore_dir_named )
&& itr->path().filename() != ignore_dir_named )
{
if ( find_file( *itr, name, path_found ) ) return true;
}
else if ( itr->path().string() == name )
else if ( itr->path().filename() == name )
{
path_found = *itr;
return true;
@ -287,16 +288,16 @@ namespace
// SunCC creates an internal subdirectory everywhere it writes
// object files. This confuses the target_directory() algorithm.
// This patch ignores the SunCC internal directory. Jens Maurer
if ( (*itr).path().string() == "SunWS_cache" ) continue;
if ( itr->path().filename() == "SunWS_cache" ) continue;
// SGI does something similar for template instantiations. Jens Maurer
if( (*itr).path().string() == "ii_files" ) continue;
if( itr->path().filename() == "ii_files" ) continue;
if ( child.empty() ) child = *itr;
else
{
std::cout << "Warning: only first of two target possibilities will be reported for: \n "
<< root.string() << ": " << child.string()
<< " and " << (*itr).path().string() << "\n";
<< root.string() << ": " << child.filename()
<< " and " << itr->path().filename() << "\n";
}
}
}
@ -368,7 +369,7 @@ const fs::path find_bin_path(const string& relative)
std::cerr << "warning: could not find build results for '"
<< relative << "'.\n";
std::cerr << "warning: tried directory "
<< bin_path.parent_path().string() << "\n";
<< bin_path.string() << "\n";
bin_path = "";
}
}
@ -563,7 +564,7 @@ const fs::path find_bin_path(const string& relative)
if ( !fs::exists( target_dir / "test_log.xml" ) )
{
std::cerr << "Missing jam_log.xml in target:\n "
std::cerr << "Missing test_log.xml in target:\n "
<< target_dir.string() << "\n";
target += "<td>" + missing_residue_msg + "</td>";
return true;
@ -574,9 +575,9 @@ const fs::path find_bin_path(const string& relative)
fs::path pth( target_dir / "test_log.xml" );
fs::ifstream file( pth );
if ( !file ) // could not open jam_log.xml
if ( !file )
{
std::cerr << "Can't open jam_log.xml in target:\n "
std::cerr << "Can't open test_log.xml in target:\n "
<< target_dir.string() << "\n";
target += "<td>" + missing_residue_msg + "</td>";
return false;
@ -745,7 +746,8 @@ const fs::path find_bin_path(const string& relative)
{
results.push_back( std::string() );
do_row( *itr,
itr->path().string().substr( 0, itr->path().string().size()-5 ),
itr->path().filename().string().substr( 0,
itr->path().filename().string().size()-5 ),
results[results.size()-1] );
}
}
@ -761,15 +763,15 @@ const fs::path find_bin_path(const string& relative)
for (; compiler_itr != end_itr; ++compiler_itr )
{
if ( fs::is_directory( *compiler_itr ) // check just to be sure
&& compiler_itr->path().string() != "test" ) // avoid strange directory (Jamfile bug?)
&& compiler_itr->path().filename() != "test" ) // avoid strange directory (Jamfile bug?)
{
if ( specific_compiler.size() != 0
&& specific_compiler != compiler_itr->path().string() ) continue;
toolsets.push_back( compiler_itr->path().string() );
string desc( compiler_desc( compiler_itr->path().string() ) );
string vers( version_desc( compiler_itr->path().string() ) );
&& specific_compiler != compiler_itr->path().filename() ) continue;
toolsets.push_back( compiler_itr->path().filename().string() );
string desc( compiler_desc( compiler_itr->path().filename().string() ) );
string vers( version_desc( compiler_itr->path().filename().string() ) );
report << "<td>"
<< (desc.size() ? desc : compiler_itr->path().string())
<< (desc.size() ? desc : compiler_itr->path().filename().string())
<< (vers.size() ? (string( "<br>" ) + vers ) : string( "" ))
<< "</td>\n";
error_count.push_back( 0 );
@ -968,8 +970,6 @@ int cpp_main( int argc, char * argv[] ) // note name!
" status-file and links-file are paths to the output files.\n"
"Must be run from directory containing Jamfile\n"
" options: --compiler name Run for named compiler only\n"
" --ignore-pass Do not report tests which pass all compilers\n"
" --no-warn Warnings not reported if test passes\n"
" --locate-root path Path to ALL_LOCATE_TARGET for bjam;\n"
" default boost-root.\n"
" --comment path Path to file containing HTML\n"
@ -1001,7 +1001,7 @@ int cpp_main( int argc, char * argv[] ) // note name!
jamfile_path = "Jamfile.v2";
else
jamfile_path = "Jamfile";
jamfile_path = fs::system_complete( jamfile_path );
jamfile_path = fs::absolute( jamfile_path, fs::initial_path() );
jamfile.open( jamfile_path );
if ( !jamfile )
{
@ -1019,7 +1019,7 @@ int cpp_main( int argc, char * argv[] ) // note name!
if ( argc == 4 )
{
fs::path links_path( argv[3] );
links_name = links_path.string();
links_name = links_path.filename().string();
links_file.open( links_path );
if ( !links_file )
{

View file

@ -764,13 +764,13 @@ int main( int argc, char ** argv )
line_start.find( ".linkonce" ) == string::npos )
)
{
if ( !test2info.size() )
{
std::cout << "*****Error - No \"boost-test\" lines encountered.\n"
" (Usually occurs when bjam was envoked without the --dump-tests option\n"
" or bjam was envoked in the wrong directory)\n";
return 1;
}
//~ if ( !test2info.size() )
//~ {
//~ std::cout << "*****Error - No \"boost-test\" lines encountered.\n"
//~ " (Usually occurs when bjam was envoked without the --dump-tests option\n"
//~ " or bjam was envoked in the wrong directory)\n";
//~ return 1;
//~ }
string action( ( line_start.find( "Link-action" ) != string::npos
|| line_start.find( "vc-Link" ) != string::npos
@ -798,7 +798,8 @@ int main( int argc, char ** argv )
// these actions are only used to stop the previous action
else if ( line_start.find( "-Archive" ) != string::npos
|| line_start.find( "MkDir" ) == 0 )
|| line_start.find( "MkDir" ) == 0
|| line_start.find( "common.mkdir" ) == 0 )
{
mgr.stop_message( content );
content.clear();

View file

@ -57,6 +57,8 @@ class runner:
help="the tag for the results" )
opt.add_option( '--toolsets',
help="comma-separated list of toolsets to test with" )
opt.add_option( '--libraries',
help="comma separated list of libraries to test")
opt.add_option( '--incremental',
help="do incremental run (do not remove previous binaries)",
action='store_true' )
@ -113,6 +115,7 @@ class runner:
self.comment='comment.html'
self.tag='trunk'
self.toolsets=None
self.libraries=None
self.incremental=False
self.timeout=5
self.bjam_options=''
@ -189,6 +192,15 @@ class runner:
self.log('XSL reports dir = %s'%self.xsl_reports_dir)
self.log('Timestamp = %s'%self.timestamp_path)
self.log('Patch Boost script = %s'%self.patch_boost)
if self.libraries is not None:
self.libraries = self.libraries.split(",")
# Boost.Build depends on any having run
if "build" in self.libraries and "any" not in self.libraries:
self.libraries += ["any"]
self.bjam_options += ' "--limit-tests=' + \
"|".join(lib for lib in self.libraries if lib != "build") + '"'
self.main()
@ -347,6 +359,9 @@ class runner:
os.chdir( cd )
def command_test_boost_build(self):
if self.libraries is not None and "build" not in self.libraries:
return
self.import_utils()
self.log( 'Running Boost.Build tests' )
# Find the true names of the toolsets used for testing
@ -362,7 +377,7 @@ class runner:
bjam_path = os.path.dirname (self.tool_path( self.bjam ))
self.log( "Using bjam binary in '%s'" % (bjam_path))
os.putenv('PATH', bjam_path + os.pathsep + os.environ['PATH'])
utils.system ( [ "%s test_all.py --default-bjam --xml %s > %s" % (sys.executable, t, fn) ] )
utils.system ( [ '"%s" test_all.py --default-bjam --xml %s > %s' % (sys.executable, t, fn) ] )
finally:
os.chdir( cd )
@ -496,11 +511,11 @@ class runner:
self.unpack_tarball( self.local, self.boost_root )
elif self.have_source:
if not self.incremental: self.command_cleanup( [ 'bin' ] )
if not self.incremental: self.command_cleanup( 'bin' )
else:
if self.incremental or self.force_update:
if not self.incremental: self.command_cleanup( [ 'bin' ] )
if not self.incremental: self.command_cleanup( 'bin' )
else:
self.command_cleanup()
self.command_get_source()

View file

@ -75,7 +75,7 @@ exe_suffix=
# The location of the binary for running bjam. The default should work
# under most circumstances.
#
bjam="$boost_root/tools/build/v2/engine/src/bin/bjam$exe_suffix"
bjam="$boost_root/tools/build/v2/engine/bin/bjam$exe_suffix"
#
# "process_jam_log", and "compiler_status" paths to built helper programs:
@ -133,7 +133,7 @@ fi
# rebuild bjam if required:
#
echo building bjam:
cd "$boost_root/tools/build/v2/engine/src" && \
cd "$boost_root/tools/build/v2/engine" && \
LOCATE_TARGET=bin sh ./build.sh
if test $? != 0 ; then
echo "bjam build failed."