Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50210 - in trunk/tools/quickbook: detail test
From: daniel_james_at_[hidden]
Date: 2008-12-08 18:14:24


Author: danieljames
Date: 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
New Revision: 50210
URL: http://svn.boost.org/trac/boost/changeset/50210

Log:
Hard fail on quickbook post process errors.
Added:
   trunk/tools/quickbook/test/fail-post-process.quickbook (contents, props changed)
Text files modified:
   trunk/tools/quickbook/detail/post_process.cpp | 5 ++++-
   trunk/tools/quickbook/detail/post_process.hpp | 2 +-
   trunk/tools/quickbook/detail/quickbook.cpp | 2 +-
   trunk/tools/quickbook/test/Jamfile.v2 | 3 +++
   4 files changed, 9 insertions(+), 3 deletions(-)

Modified: trunk/tools/quickbook/detail/post_process.cpp
==============================================================================
--- trunk/tools/quickbook/detail/post_process.cpp (original)
+++ trunk/tools/quickbook/detail/post_process.cpp 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
@@ -417,7 +417,7 @@
         int indent;
     };
 
- void post_process(
+ int post_process(
         std::string const& in
       , std::ostream& out
       , int indent
@@ -437,6 +437,7 @@
             if (r.full)
             {
                 out << tidy;
+ return 0;
             }
             else
             {
@@ -445,6 +446,7 @@
                     << "Warning: Post Processing Failed."
                     << std::endl;
                 out << in;
+ return 1;
             }
         }
 
@@ -455,6 +457,7 @@
                 << "Warning: Post Processing Failed."
                 << std::endl;
             out << in;
+ return 1;
         }
     }
 }

Modified: trunk/tools/quickbook/detail/post_process.hpp
==============================================================================
--- trunk/tools/quickbook/detail/post_process.hpp (original)
+++ trunk/tools/quickbook/detail/post_process.hpp 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
@@ -14,7 +14,7 @@
 
 namespace quickbook
 {
- void post_process(
+ int post_process(
         std::string const& in
       , std::ostream& out
       , int indent

Modified: trunk/tools/quickbook/detail/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/detail/quickbook.cpp (original)
+++ trunk/tools/quickbook/detail/quickbook.cpp 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
@@ -122,7 +122,7 @@
             result = parse(filein_, outdir, buffer);
             if (result == 0)
             {
- post_process(buffer.str(), fileout, indent, linewidth);
+ result = post_process(buffer.str(), fileout, indent, linewidth);
             }
         }
         else

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
@@ -27,6 +27,9 @@
     [ quickbook-fail-test fail-template-arguments2 ]
     [ quickbook-fail-test fail-cpp-mismatched-escape ]
     [ quickbook-fail-test fail-python-mismatched-escape ]
+ [ quickbook-fail-test fail-post-process ]
+ [ quickbook-fail-test fail-parse-error1 ]
+ [ quickbook-fail-test fail-parse-error2 ]
     ;
 
 

Added: trunk/tools/quickbook/test/fail-post-process.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/fail-post-process.quickbook 2008-12-08 18:14:23 EST (Mon, 08 Dec 2008)
@@ -0,0 +1,3 @@
+[article Fail post process due to invalid embedded xml [quickbook 1.4] ]
+
+Invalid xml follows: '''<!--quickbook-escape-postfix--><>'''


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