14
14
#include < boost/program_options.hpp>
15
15
#include < boost/system/config.hpp>
16
16
17
-
18
17
#include < filesystem>
19
18
20
19
namespace fs = std::filesystem;
@@ -24,8 +23,8 @@ namespace bpo = boost::program_options;
24
23
// ////////////////////////////////////////////////////////////////////////
25
24
26
25
static bool parseAndEmitFormatted (cppparser::CppParser& parser,
27
- const fs::path& inputFilePath,
28
- const fs::path& outputFilePath,
26
+ const fs::path& inputFilePath,
27
+ const fs::path& outputFilePath,
29
28
const cppcodegen::CppWriter& cppWriter)
30
29
{
31
30
auto progUnit = parser.parseFile (inputFilePath.string ().c_str ());
@@ -61,17 +60,17 @@ static std::pair<size_t, size_t> performTest(cppparser::CppParser& parser, const
61
60
++dirItr)
62
61
{
63
62
cppcodegen::CppWriter cppWriter;
64
- fs::path file = *dirItr;
63
+ fs::path file = *dirItr;
65
64
if (fs::is_regular_file (file))
66
65
{
67
66
++numInputFiles;
68
67
std::cout << " CppParserTest: Parsing " << file.string () << " ...\n " ;
69
- auto fileRelPath = file.string ().substr (inputPathLen);
70
- fs::path outfile = params.outputPath / fileRelPath;
68
+ const auto fileRelPath = file.string ().substr (inputPathLen + 1 );
69
+ fs::path outfile = params.outputPath / fileRelPath;
71
70
fs::remove (outfile);
72
71
if (parseAndEmitFormatted (parser, file, outfile, cppWriter) && fs::exists (outfile))
73
72
{
74
- fs::path masfile = params.masterPath / fileRelPath;
73
+ fs::path masfile = params.masterPath / fileRelPath;
75
74
std::pair<int , int > diffStartInfo;
76
75
auto rez = compareFiles (outfile, masfile, diffStartInfo);
77
76
if (rez == kSameFiles )
0 commit comments