Ticket #35339: patch-test-rbkt-testdriver_mt.cpp.diff

File patch-test-rbkt-testdriver_mt.cpp.diff, 6.7 KB (added by cezar.andrei@…, 12 years ago)

patch3 in files dir

  • test/rbkt/testdriver_mt.cpp

    === modified file 'test/rbkt/testdriver_mt.cpp'
     
    4444#include "testdriver_comparator.h"
    4545#include "testdriver_common.h"
    4646
    47 #define BOOST_FILESYSTEM_VERSION 2
     47#define BOOST_FILESYSTEM_VERSION 3
    4848
    4949// These are included last because they define the <stdint.h>'s INTMAX_C and UINTMAX_C
    5050#include <boost/filesystem/operations.hpp>
     
    233233********************************************************************************/
    234234void createPath(const fs::path& filePath, std::ofstream& fileStream)
    235235{
    236   fileStream.open(filePath.file_string().c_str());
     236  fileStream.open(filePath.c_str());
    237237  if (!fileStream.good())
    238238  {
    239239    fs::path dirPath = filePath;
    240240    dirPath = dirPath.remove_leaf();
    241241   
    242     if (!fs::exists(dirPath.file_string()))
     242    if (!fs::exists(dirPath))
    243243    {
    244       fs::create_directories(dirPath.file_string());
     244      fs::create_directories(dirPath);
    245245
    246246      // clear the bad flag on windows, which for some unknown reason doesn't reset when opening a file again
    247247      fileStream.clear();
    248       fileStream.open(filePath.file_string().c_str());
     248      fileStream.open(filePath.c_str());
    249249    }
    250250
    251251    if (!fileStream.good())
    252252    {
    253253      std::cerr << "Could not open file: "
    254                 << filePath.file_string() << std::endl;
     254                << filePath.string() << std::endl;
    255255      abort();
    256256    }
    257257  }
     
    380380    relativeQueryFile = queries->theQueryFilenames[queryNo];
    381381    queryPath = fs::path(queries->theQueriesDir) / (relativeQueryFile);
    382382
    383     std::string testName = fs::change_extension(queryPath, "").file_string();
     383    std::string testName = fs::change_extension(queryPath, "").string();
    384384    ulong pos = testName.find("Queries");
    385385    testName = testName.substr(pos + 8);
    386386
     
    393393    // exprected errors, or the pathnames of reference-result files.
    394394    specPath = fs::change_extension(queryPath, ".spec");
    395395    if (fs::exists(specPath))
    396       querySpec.parseFile(specPath.file_string(), rbkt_src_dir, rbkt_bin_dir);
     396      querySpec.parseFile(specPath.string(), rbkt_src_dir, rbkt_bin_dir);
    397397
    398398    // Get the pathnames of the ref-result files found in the .spec file (if any).
    399399    // If no ref-results file was specified in the .spec file, create a default
     
    494494    setModulePaths(module_path, sctx);
    495495
    496496    // Set the error file to be used by the error handler for the current query
    497     errHandler.setErrorFile(errorFilePath.file_string());
     497    errHandler.setErrorFile(errorFilePath.string());
    498498
    499499    //
    500500    // Compile the query, if it has not been compiled already.
    501501    //
    502502    if (queries->theQueryObjects[queryNo] == 0)
    503503    {
    504       slurp_file(queryPath.file_string().c_str(),
     504      slurp_file(queryPath.c_str(),
    505505                 queryString,
    506506                 rbkt_src_dir,
    507507                 rbkt_bin_dir);
     
    509509      try
    510510      {
    511511        query = zorba->createQuery(&errHandler);
    512         query->setFileName(queryPath.file_string());
     512        query->setFileName(queryPath.string());
    513513        query->compile(queryString.c_str(), sctx, getCompilerHints());
    514514      }
    515515      catch(...)
     
    632632      ulong i;
    633633      for (i = 0; i < refFilePaths.size(); i++)
    634634      {
    635         std::string refFilePath = refFilePaths[i].file_string();
    636         std::string resFilePath = resultFilePath.file_string();
     635        std::string refFilePath = refFilePaths[i].string();
     636        std::string resFilePath = resultFilePath.string();
    637637
    638638        int lLine, lCol;
    639639        std::string lRefLine, lResultLine;
     
    879879  // Make sure the directories exist. For the results dir, if it doesn't exist,
    880880  // it is created.
    881881  //
    882   path = fs::system_complete(fs::path(queriesDir, fs::native));
     882  path = fs::system_complete(fs::path(queriesDir));
    883883  if (!fs::is_directory(path))
    884884  {
    885885    std::cerr << "The directory " << queriesDir << " could not be found" << std::endl;
    886886    exit(2);
    887887  }
    888   queries.theQueriesDir = path.native_directory_string();
     888  queries.theQueriesDir = path.string();
    889889
    890   path = fs::system_complete(fs::path(refsDir, fs::native));
     890  path = fs::system_complete(fs::path(refsDir));
    891891  if (!fs::is_directory(path))
    892892  {
    893893    std::cerr << "The directory " << refsDir << " could not be found" << std::endl;
    894894    exit(2);
    895895  }
    896   queries.theRefsDir = path.native_directory_string();
     896  queries.theRefsDir = path.string();
    897897
    898   path = fs::system_complete(fs::path(resultsDir, fs::native));
     898  path = fs::system_complete(fs::path(resultsDir));
    899899  if (!fs::exists(path))
    900900  {
    901901    fs::create_directories(path);
     
    905905    std::cerr << "The pathname " << resultsDir << " is not a directory" << std::endl;
    906906    exit(2);
    907907  }
    908   queries.theResultsDir = path.native_directory_string();
     908  queries.theResultsDir = path.string();
    909909
    910910  //
    911911  // Search and collect all the query files in the bucket, unless some
     
    934934        continue;
    935935      }
    936936
    937       std::string queryFile = queryPath.file_string();
     937      std::string queryFile = queryPath.string();
    938938      std::string relativeQueryFile = queryFile.substr(queries.theQueriesDir.size());
    939939
    940940      queries.theQueryFilenames.push_back(relativeQueryFile);
     
    10541054    bool queryWasKnownToFail = false;
    10551055    if (haveKnownFailures)
    10561056    {
    1057       queryWasKnownToFail = (knownFailures.count(queryName.file_string()) != 0);
     1057      queryWasKnownToFail = (knownFailures.count(queryName.string()) != 0);
    10581058    }
    10591059
    10601060    if (queries.theQueryStates[i] == false)
    10611061    {
    10621062      numFailures++;
    1063       failedTests << queryName.file_string() << std::endl;
     1063      failedTests << queryName.string() << std::endl;
    10641064
    10651065      if (haveKnownFailures && !queryWasKnownToFail)
    10661066      {
    10671067        numRegressions++;
    10681068        report << "REGRESSION:" << i << ":"
    1069                << queryName.file_string() << std::endl;
     1069               << queryName.string() << std::endl;
    10701070      }
    10711071      else if (!haveKnownFailures)
    10721072      {
    1073         report << i << ":" << queryName.file_string() << std::endl;
     1073        report << i << ":" << queryName.string() << std::endl;
    10741074      }
    10751075    }
    10761076    else
     
    10791079      {
    10801080        numProgressions++;
    10811081        report << "Progression:" << i << ":"
    1082                << queryName.file_string() << std::endl;
     1082               << queryName.string() << std::endl;
    10831083      }
    10841084    }
    10851085    if(generateW3CData)
    10861086    {
    10871087      std::string status = (queries.theQueryStates[i] ==  true)?"pass":"fail";
    1088       XMLreport << "<Test Status='" << status << "'><Name>" << queryName.file_string() << "</Name></Test>" << std::endl;
     1088      XMLreport << "<Test Status='" << status << "'><Name>" << queryName.string() << "</Name></Test>" << std::endl;
    10891089    }
    10901090  }
    10911091