Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85095 - branches/release/tools/regression/build branches/release/tools/regression/src trunk/tools/regression/build
From: robert.kawulak_at_[hidden]
Date: 2013-07-20 16:14:28


Author: rkawulak
Date: 2013-07-20 16:14:28 EDT (Sat, 20 Jul 2013)
New Revision: 85095
URL: http://svn.boost.org/trac/boost/changeset/85095

Log:
[regression] Merged out-of-sync files from trunk to release. Make bin dir ignored.

Properties modified:
   branches/release/tools/regression/build/ (props changed)
   trunk/tools/regression/build/ (props changed)
Text files modified:
   branches/release/tools/regression/src/compiler_status.cpp | 36 ++++++++++++----
   branches/release/tools/regression/src/library_status.cpp | 84 +++++++++++++++++----------------------
   2 files changed, 63 insertions(+), 57 deletions(-)

Modified: branches/release/tools/regression/src/compiler_status.cpp
==============================================================================
--- branches/release/tools/regression/src/compiler_status.cpp Sat Jul 20 15:38:36 2013 (r85094)
+++ branches/release/tools/regression/src/compiler_status.cpp 2013-07-20 16:14:28 EDT (Sat, 20 Jul 2013) (r85095)
@@ -34,7 +34,7 @@
 namespace xml = boost::tiny_xml;
 
 #include <cstdlib> // for abort, exit
-#include <cctype> // for toupper
+#include <cctype> // for toupper, isdigit
 #include <string>
 #include <vector>
 #include <set>
@@ -46,6 +46,15 @@
 #include <stdexcept>
 #include <cassert>
 
+#include <stdio.h> // for popen, pclose
+#if defined(_MSC_VER)
+# define POPEN _popen
+# define PCLOSE _pclose
+#else
+# define POPEN popen
+# define PCLOSE pclose
+#endif
+
 using std::string;
 
 const string pass_msg( "Pass" );
@@ -107,15 +116,24 @@
   string revision( const fs::path & boost_root )
   {
     string rev;
- fs::path entries( boost_root / ".svn" / "entries" );
- fs::ifstream entries_file( entries );
- if ( entries_file )
- {
- std::getline( entries_file, rev );
- std::getline( entries_file, rev );
- std::getline( entries_file, rev );
- std::getline( entries_file, rev ); // revision number as a string
+ string command("cd ");
+ command += boost_root.string() + " & svn info";
+ FILE* fp = POPEN(command.c_str(), "r");
+ if (fp)
+ {
+ static const int line_max = 128;
+ char line[line_max];
+ while (fgets(line, line_max, fp) != NULL)
+ {
+ string ln(line);
+ if (ln.find("Revision: ") != string::npos)
+ {
+ for(auto itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
+ rev += *itr;
+ }
+ }
     }
+ std::cout << "Revision: " << rev << std::endl;
     return rev;
   }
 

Modified: branches/release/tools/regression/src/library_status.cpp
==============================================================================
--- branches/release/tools/regression/src/library_status.cpp Sat Jul 20 15:38:36 2013 (r85094)
+++ branches/release/tools/regression/src/library_status.cpp 2013-07-20 16:14:28 EDT (Sat, 20 Jul 2013) (r85095)
@@ -1,6 +1,5 @@
 // Generate Library Status HTML from jam regression test output -----------//
 
-// Copyright Robert Ramey 2012
 // Copyright Bryce Lelbach 2011
 // Copyright Beman Dawes 2002-2011.
 
@@ -170,18 +169,19 @@
 
     // find_element ------------------------------------------------------------//
 
+ struct element_equal {
+ const string & m_name;
+ element_equal(const string & name) :
+ m_name(name)
+ {}
+ bool operator()(const xml::element_ptr & xep) const {
+ return xep.get()->name == m_name;
+ }
+ };
+
     xml::element_list::const_iterator find_element(
         const xml::element & root, const string & name
     ){
- struct element_equal {
- const string & m_name;
- element_equal(const string & name) :
- m_name(name)
- {}
- bool operator()(const xml::element_ptr & xep) const {
- return xep.get()->name == m_name;
- }
- };
         return std::find_if(
             root.elements.begin(),
             root.elements.end(),
@@ -202,19 +202,20 @@
 
     // attribute_value ----------------------------------------------------------//
 
+ struct attribute_equal {
+ const string & m_name;
+ attribute_equal(const string & name) :
+ m_name(name)
+ {}
+ bool operator()(const xml::attribute & a) const {
+ return a.name == m_name;
+ }
+ };
+
     const string & attribute_value(
         const xml::element & element,
         const string & attribute_name
     ){
- struct attribute_equal {
- const string & m_name;
- attribute_equal(const string & name) :
- m_name(name)
- {}
- bool operator()(const xml::attribute & a) const {
- return a.name == m_name;
- }
- };
         xml::attribute_list::const_iterator itr;
         itr = std::find_if(
             element.attributes.begin(),
@@ -368,6 +369,13 @@
         return result;
     }
 
+ struct has_fail_result {
+ //bool operator()(const boost::shared_ptr<const xml::element> e) const {
+ bool operator()(const xml::element_ptr & e) const {
+ return attribute_value(*e, "result") == "fail";
+ }
+ };
+
     // do_cell ---------------------------------------------------------------//
     bool do_cell(
         const fs::path & target_dir,
@@ -389,8 +397,6 @@
             return true;
         }
 
- int anything_generated = 0;
-
 
         string test_type( "unknown" );
         bool always_show_run_output( false );
@@ -402,33 +408,15 @@
         always_show_run_output
             = attribute_value( db, "show-run-output" ) == "true";
 
- /*
- test_type = attribute_value( db, "test-type" );
- std::string test_type_base( test_type );
- if ( test_type_base.size() > 5 )
- {
- const string::size_type trailer = test_type_base.size() - 5;
- if ( test_type_base.substr( trailer ) == "_fail" )
- {
- test_type_base.erase( trailer );
- }
- }
- if ( test_type_base.size() > 4 )
- {
- const string::size_type trailer = test_type_base.size() - 4;
- if ( test_type_base.substr( trailer ) == "_pyd" )
- {
- test_type_base.erase( trailer );
- }
- }
-
- xml::element_list::const_iterator itr;
- itr = find_element( db, test_type_base );
- if(db.elements.end() == itr)
- return pass;
- */
- pass = (attribute_value( db, "result" ) != "fail");
+ // if we don't find any failures
+ // mark it as a pass
+ pass = (db.elements.end() == std::find_if(
+ db.elements.begin(),
+ db.elements.end(),
+ has_fail_result()
+ ));
 
+ int anything_generated = 0;
         if (!no_links){
             anything_generated =
                 generate_report(
@@ -483,7 +471,7 @@
     ){
         bool retval = false;
         if(node.is_leaf){
- retval = do_cell(
+ return do_cell(
                 dir_root,
                 lib_name,
                 test_name,


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