$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r61381 - in trunk/libs/wave/test/testwave: . testfiles
From: hartmut.kaiser_at_[hidden]
Date: 2010-04-18 16:29:55
Author: hkaiser
Date: 2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
New Revision: 61381
URL: http://svn.boost.org/trac/boost/changeset/61381
Log:
Wave: fixing regression test failures
Text files modified: 
   trunk/libs/wave/test/testwave/testfiles/t_2_019.cpp |     2                                         
   trunk/libs/wave/test/testwave/testfiles/t_6_063.cpp |     2                                         
   trunk/libs/wave/test/testwave/testfiles/t_6_067.cpp |     2                                         
   trunk/libs/wave/test/testwave/testwave_app.cpp      |    54 +++++++++++++++++++++++++++++++++++++-- 
   trunk/libs/wave/test/testwave/testwave_app.hpp      |     1                                         
   5 files changed, 55 insertions(+), 6 deletions(-)
Modified: trunk/libs/wave/test/testwave/testfiles/t_2_019.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_2_019.cpp	(original)
+++ trunk/libs/wave/test/testwave/testfiles/t_2_019.cpp	2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
@@ -28,7 +28,7 @@
 
 //H 10: t_2_019.cpp(13): #include "t_2_019_001.hpp"
 //H 04: "t_2_019_001.hpp"
-//H 05: t_2_019_001.hpp ($B(t_2_019_001.hpp))
+//H 05: $S(t_2_019_001.hpp) ($B(t_2_019_001.hpp))
 //H 10: t_2_019_001.hpp(10): #pragma
 //H 20: t_2_019_001.hpp(10): #pragma: $B(t_2_019_001.hpp)
 //H 06: 
Modified: trunk/libs/wave/test/testwave/testfiles/t_6_063.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_6_063.cpp	(original)
+++ trunk/libs/wave/test/testwave/testfiles/t_6_063.cpp	2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
@@ -24,7 +24,7 @@
 
 //H 10: t_6_063.cpp(20): #include "t_6_063.hpp"
 //H 04: "t_6_063.hpp"
-//H 05: t_6_063.hpp ($B(t_6_063.hpp))
+//H 05: $S(t_6_063.hpp) ($B(t_6_063.hpp))
 //H 18: boost::wave::preprocess_exception
 
 /*-
Modified: trunk/libs/wave/test/testwave/testfiles/t_6_067.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_6_067.cpp	(original)
+++ trunk/libs/wave/test/testwave/testfiles/t_6_067.cpp	2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
@@ -24,7 +24,7 @@
 
 //H 10: t_6_067.cpp(20): #include "t_6_067.hpp"
 //H 04: "t_6_067.hpp"
-//H 05: t_6_067.hpp ($B(t_6_067.hpp))
+//H 05: $S(t_6_067.hpp) ($B(t_6_067.hpp))
 //H 18: boost::wave::lexing_exception
 
 /*-
Modified: trunk/libs/wave/test/testwave/testwave_app.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testwave_app.cpp	(original)
+++ trunk/libs/wave/test/testwave/testwave_app.cpp	2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
@@ -188,7 +188,7 @@
                 break;
 
             case 'P':       // insert full path
-            case 'B':       // same as 'P', but forward slashs on Windows
+            case 'B':       // same as 'P', but forward slashes on Windows
                 {
                     fs::path fullpath (
                         fs::complete(
@@ -229,8 +229,56 @@
                                 boost::wave::util::native_file_string(fullpath));
                         }
                         else {
-                            full_result += 
-                                escape_lit(fullpath.string());
+                            full_result += escape_lit(fullpath.string());
+                        }
+                        pos1 = expected.find_first_of ("$", pos = pos1 + 2);
+                    }
+                }
+                break;
+
+            case 'R':       // insert relative file name
+            case 'S':       // same as 'R', but forward slashes on Windows 
+                {
+                    fs::path relpath;
+                    boost::wave::util::as_relative_to(
+                        boost::wave::util::create_path(filename), 
+                        boost::wave::util::current_path(),
+                        relpath);
+
+                    if ('(' == expected[pos1+2]) {
+                    // the $R(basename) syntax is used
+                        std::size_t p = expected.find_first_of(")", pos1+1);
+                        if (std::string::npos == p) {
+                            std::cerr 
+                                << "testwave: unmatched parenthesis in $R"
+                                    " directive" << std::endl;
+                            return false;
+                        }
+                        std::string base = expected.substr(pos1+3, p-pos1-3);
+                        relpath = boost::wave::util::branch_path(relpath) / 
+                            boost::wave::util::create_path(base);
+                        full_result += expected.substr(pos, pos1-pos);
+                        if ('R' == expected[pos1+1]) {
+                            full_result += escape_lit(
+                                boost::wave::util::native_file_string(
+                                    boost::wave::util::normalize(relpath)));
+                        }
+                        else {
+                            full_result += escape_lit(
+                                boost::wave::util::normalize(relpath).string());
+                        }
+                        pos1 = expected.find_first_of ("$", 
+                            pos = pos1 + 4 + base.size());
+                    }
+                    else {
+                    // the $R is used on its own
+                        full_result += expected.substr(pos, pos1-pos);
+                        if ('R' == expected[pos1+1]) {
+                            full_result += escape_lit(
+                                boost::wave::util::native_file_string(relpath));
+                        }
+                        else {
+                            full_result += escape_lit(relpath.string());
                         }
                         pos1 = expected.find_first_of ("$", pos = pos1 + 2);
                     }
Modified: trunk/libs/wave/test/testwave/testwave_app.hpp
==============================================================================
--- trunk/libs/wave/test/testwave/testwave_app.hpp	(original)
+++ trunk/libs/wave/test/testwave/testwave_app.hpp	2010-04-18 16:29:54 EDT (Sun, 18 Apr 2010)
@@ -98,6 +98,7 @@
     //      $E: to the result of preprocessing the given expression
     //      $F: to the passed full filepath 
     //      $P: to the full path
+    //      $R: to the relative path
     //      $V: to the current Boost version number
     bool got_expected_result(std::string const& filename, 
         std::string const& result, std::string& expected);