Add library name, more selection flexibility, new notes map file format

[SVN r21058]
This commit is contained in:
Beman Dawes 2003-12-02 02:08:17 +00:00
parent 740140dacf
commit b596f1b405
2 changed files with 103 additions and 71 deletions

View file

@ -1,66 +1,92 @@
// Notes map format:
//
// toolset/test-name,note-#
// toolset/*library-name,note-#
// toolset/library-name/test-name,note#
// */library-name/test-name,note#
// toolset/library-name/*,note#
// */library-name/*,note#
//
// The * can only be used to indicate "all" - it can't select portions
// of a toolset or test name.
//
// Multiple notes can apply to the same test or library. For example:
//
// borland/random/random_test,2
// borland/random/random_test,10
//
// Note superscripts normally only appear if a test fails. If the note#
// is preceded by a minus sign, the note superscript will appear regardless
// of success or failure of the test.
// Borland
borland/random_test,2
borland/*cxx98,3
borland/lib_function_test,3
borland/lambda_test,3
borland/signal_test,3
borland/random/random_test,2
borland/function/function_arith_cxx98,3
borland/function/function_ref_cxx98,3
borland/function/lambda_test,3
borland/function/lib_function_test,3
borland/function/mem_fun_cxx98,3
borland/function/std_bind_cxx98,3
borland/function/sum_avg_cxx98,3
borland/signals/signal_test,3
// GCC
gcc/testmicrosec_time_clock,14
gcc/interoperable_fail,3
gcc/*thread,6
gcc/date_time/testmicrosec_time_clock,14
gcc/iterator/interoperable_fail,3
gcc/thread/*,6
// Codewarrior
cwpro8/class_concept_fail_expected,3
cwpro8/limits_test,3
cwpro8/static_assert_test_fail_8,3
cwpro8/random_test,3
cwpro8/lib_function_test,2
cwpro8/lambda_test,2
cwpro8/mem_fun_cxx98,2
cwpro8/signal_test,2
cwpro8/concept_check/class_concept_fail_expected,3
cwpro8/config/limits_test,3
cwpro8/static_assert/static_assert_test_fail_8,3
cwpro8/random/random_test,3
cwpro8/function/lib_function_test,2
cwpro8/function/lambda_test,2
cwpro8/function/mem_fun_cxx98,2
cwpro8/signals/signal_test,2
// Comeau
como-win32/errors_handling_test,3
como-win32/fun_out_iter_example,4
como-win32/random_test,3
como-win32/*thread,10
como-win32/test/errors_handling_test,3
como-win32/utility/fun_out_iter_example,4
como-win32/random/random_test,3
como-win32/thread/*,10
// Intel
intel-win32/config_test,3
intel-win32/*date_time,10
intel-win32/quaternion_mult_incl_test,3
intel-win32/random_test,3
intel-win32/io_test,3
intel-win32/*regex,10
intel-win32/config/config_test,3
intel-win32/date_time/*,10
intel-win32/math/quaternion_mult_incl_test,3
intel-win32/random/random_test,3
intel-win32/tuple/io_test,3
intel-win32/regex/*,10
// VC++ 6.0
msvc/*random,10
msvc/allocator_test,5
msvc/*cxx98,3
msvc/lib_function_test,3
msvc/lambda_test,3
msvc/signal_test,3
msvc/std_bind_portable,5
msvc/random/*,10
msvc/function/allocator_test,5
msvc/function/function_arith_cxx98,3
msvc/function/function_ref_cxx98,3
msvc/function/mem_fun_cxx98,3
msvc/function/std_bind_cxx98,3
msvc/function/sum_avg_cxx98,3
msvc/function/lib_function_test,3
msvc/function/lambda_test,3
msvc/function/std_bind_portable,5
msvc/signals/signal_test,3
// VC++ 7.0
vc7/*random,10
vc7/test_mutex,0
vc7/test_mutex,6
vc7/allocator_test,5
vc7/*cxx98,3
vc7/lib_function_test,3
vc7/lambda_test,3
vc7/signal_test,3
vc7/random/*,10
vc7/thread/test_mutex,0
vc7/thread/test_mutex,6
vc7/function/allocator_test,5
vc7/function/function_arith_cxx98,3
vc7/function/function_ref_cxx98,3
vc7/function/mem_fun_cxx98,3
vc7/function/std_bind_cxx98,3
vc7/function/sum_avg_cxx98,3
vc7/function/lib_function_test,3
vc7/functin/lambda_test,3
vc7/signals/signal_test,3

View file

@ -412,29 +412,48 @@ const string & attribute_value( const xml::element & element,
return result;
}
// do_notes --------------------------------------------------------------//
// add_notes --------------------------------------------------------------//
void do_notes( const string & key, string & sep, string & target )
void add_notes( const string & key, bool fail, string & sep, string & target )
{
notes_map::const_iterator itr = notes.lower_bound( key );
if ( itr != notes.end() && itr->first == key )
{
target += "<sup>";
for ( ; itr != notes.end() && itr->first == key; ++itr )
{
target += sep;
sep = ",";
target += "<a href=\"";
target += "#";
target += itr->second;
target += "\">";
target += itr->second;
target += "</a>";
string note_desc( itr->second[0] == '-'
? itr->second.substr( 1 ) : itr->second );
if ( fail || itr->second[0] == '-' )
{
target += sep;
sep = ",";
target += "<a href=\"";
target += "#";
target += note_desc;
target += "\">";
target += note_desc;
target += "</a>";
}
}
target += "</sup>";
}
}
// get_notes -------------------------------------------------------------//
string get_notes( const string & toolset,
const string & library, const string & test, bool fail )
{
string sep;
string target( "<sup>" );
add_notes( toolset + "/" + library + "/" + test, fail, sep, target );
add_notes( "*/" + library + "/" + test, fail, sep, target );
add_notes( toolset + "/" + library + "/*", fail, sep, target );
add_notes( "*/" + library + "/*", fail, sep, target );
if ( target == "<sup>" ) target.clear();
else target += "</sup>";
return target;
}
// do_cell ---------------------------------------------------------------//
bool do_cell( const string & lib_name,
@ -500,22 +519,9 @@ const string & attribute_value( const xml::element & element,
}
else target += pass ? pass_msg : fail_msg;
// if notes, generate the HTML
if ( !notes.empty() )
{
// test-specific notes
string key( toolset );
key += "/";
key += test_name;
string sep;
do_notes( key, sep, target );
// library-wide notes
key = toolset;
key += "/*";
key += lib_name;
do_notes( key, sep, target );
}
// if notes, generate the superscript HTML
if ( !notes.empty() )
target += get_notes( toolset, lib_name, test_name, !pass );
target += "</td>";
return (anything_generated != 0) || !pass;