=== modified file 'test/rbkt/testdriver_mt.cpp'
|
|
|
44 | 44 | #include "testdriver_comparator.h" |
45 | 45 | #include "testdriver_common.h" |
46 | 46 | |
47 | | #define BOOST_FILESYSTEM_VERSION 2 |
| 47 | #define BOOST_FILESYSTEM_VERSION 3 |
48 | 48 | |
49 | 49 | // These are included last because they define the <stdint.h>'s INTMAX_C and UINTMAX_C |
50 | 50 | #include <boost/filesystem/operations.hpp> |
… |
… |
|
233 | 233 | ********************************************************************************/ |
234 | 234 | void createPath(const fs::path& filePath, std::ofstream& fileStream) |
235 | 235 | { |
236 | | fileStream.open(filePath.file_string().c_str()); |
| 236 | fileStream.open(filePath.c_str()); |
237 | 237 | if (!fileStream.good()) |
238 | 238 | { |
239 | 239 | fs::path dirPath = filePath; |
240 | 240 | dirPath = dirPath.remove_leaf(); |
241 | 241 | |
242 | | if (!fs::exists(dirPath.file_string())) |
| 242 | if (!fs::exists(dirPath)) |
243 | 243 | { |
244 | | fs::create_directories(dirPath.file_string()); |
| 244 | fs::create_directories(dirPath); |
245 | 245 | |
246 | 246 | // clear the bad flag on windows, which for some unknown reason doesn't reset when opening a file again |
247 | 247 | fileStream.clear(); |
248 | | fileStream.open(filePath.file_string().c_str()); |
| 248 | fileStream.open(filePath.c_str()); |
249 | 249 | } |
250 | 250 | |
251 | 251 | if (!fileStream.good()) |
252 | 252 | { |
253 | 253 | std::cerr << "Could not open file: " |
254 | | << filePath.file_string() << std::endl; |
| 254 | << filePath.string() << std::endl; |
255 | 255 | abort(); |
256 | 256 | } |
257 | 257 | } |
… |
… |
|
380 | 380 | relativeQueryFile = queries->theQueryFilenames[queryNo]; |
381 | 381 | queryPath = fs::path(queries->theQueriesDir) / (relativeQueryFile); |
382 | 382 | |
383 | | std::string testName = fs::change_extension(queryPath, "").file_string(); |
| 383 | std::string testName = fs::change_extension(queryPath, "").string(); |
384 | 384 | ulong pos = testName.find("Queries"); |
385 | 385 | testName = testName.substr(pos + 8); |
386 | 386 | |
… |
… |
|
393 | 393 | // exprected errors, or the pathnames of reference-result files. |
394 | 394 | specPath = fs::change_extension(queryPath, ".spec"); |
395 | 395 | 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); |
397 | 397 | |
398 | 398 | // Get the pathnames of the ref-result files found in the .spec file (if any). |
399 | 399 | // If no ref-results file was specified in the .spec file, create a default |
… |
… |
|
494 | 494 | setModulePaths(module_path, sctx); |
495 | 495 | |
496 | 496 | // 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()); |
498 | 498 | |
499 | 499 | // |
500 | 500 | // Compile the query, if it has not been compiled already. |
501 | 501 | // |
502 | 502 | if (queries->theQueryObjects[queryNo] == 0) |
503 | 503 | { |
504 | | slurp_file(queryPath.file_string().c_str(), |
| 504 | slurp_file(queryPath.c_str(), |
505 | 505 | queryString, |
506 | 506 | rbkt_src_dir, |
507 | 507 | rbkt_bin_dir); |
… |
… |
|
509 | 509 | try |
510 | 510 | { |
511 | 511 | query = zorba->createQuery(&errHandler); |
512 | | query->setFileName(queryPath.file_string()); |
| 512 | query->setFileName(queryPath.string()); |
513 | 513 | query->compile(queryString.c_str(), sctx, getCompilerHints()); |
514 | 514 | } |
515 | 515 | catch(...) |
… |
… |
|
632 | 632 | ulong i; |
633 | 633 | for (i = 0; i < refFilePaths.size(); i++) |
634 | 634 | { |
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(); |
637 | 637 | |
638 | 638 | int lLine, lCol; |
639 | 639 | std::string lRefLine, lResultLine; |
… |
… |
|
879 | 879 | // Make sure the directories exist. For the results dir, if it doesn't exist, |
880 | 880 | // it is created. |
881 | 881 | // |
882 | | path = fs::system_complete(fs::path(queriesDir, fs::native)); |
| 882 | path = fs::system_complete(fs::path(queriesDir)); |
883 | 883 | if (!fs::is_directory(path)) |
884 | 884 | { |
885 | 885 | std::cerr << "The directory " << queriesDir << " could not be found" << std::endl; |
886 | 886 | exit(2); |
887 | 887 | } |
888 | | queries.theQueriesDir = path.native_directory_string(); |
| 888 | queries.theQueriesDir = path.string(); |
889 | 889 | |
890 | | path = fs::system_complete(fs::path(refsDir, fs::native)); |
| 890 | path = fs::system_complete(fs::path(refsDir)); |
891 | 891 | if (!fs::is_directory(path)) |
892 | 892 | { |
893 | 893 | std::cerr << "The directory " << refsDir << " could not be found" << std::endl; |
894 | 894 | exit(2); |
895 | 895 | } |
896 | | queries.theRefsDir = path.native_directory_string(); |
| 896 | queries.theRefsDir = path.string(); |
897 | 897 | |
898 | | path = fs::system_complete(fs::path(resultsDir, fs::native)); |
| 898 | path = fs::system_complete(fs::path(resultsDir)); |
899 | 899 | if (!fs::exists(path)) |
900 | 900 | { |
901 | 901 | fs::create_directories(path); |
… |
… |
|
905 | 905 | std::cerr << "The pathname " << resultsDir << " is not a directory" << std::endl; |
906 | 906 | exit(2); |
907 | 907 | } |
908 | | queries.theResultsDir = path.native_directory_string(); |
| 908 | queries.theResultsDir = path.string(); |
909 | 909 | |
910 | 910 | // |
911 | 911 | // Search and collect all the query files in the bucket, unless some |
… |
… |
|
934 | 934 | continue; |
935 | 935 | } |
936 | 936 | |
937 | | std::string queryFile = queryPath.file_string(); |
| 937 | std::string queryFile = queryPath.string(); |
938 | 938 | std::string relativeQueryFile = queryFile.substr(queries.theQueriesDir.size()); |
939 | 939 | |
940 | 940 | queries.theQueryFilenames.push_back(relativeQueryFile); |
… |
… |
|
1054 | 1054 | bool queryWasKnownToFail = false; |
1055 | 1055 | if (haveKnownFailures) |
1056 | 1056 | { |
1057 | | queryWasKnownToFail = (knownFailures.count(queryName.file_string()) != 0); |
| 1057 | queryWasKnownToFail = (knownFailures.count(queryName.string()) != 0); |
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | if (queries.theQueryStates[i] == false) |
1061 | 1061 | { |
1062 | 1062 | numFailures++; |
1063 | | failedTests << queryName.file_string() << std::endl; |
| 1063 | failedTests << queryName.string() << std::endl; |
1064 | 1064 | |
1065 | 1065 | if (haveKnownFailures && !queryWasKnownToFail) |
1066 | 1066 | { |
1067 | 1067 | numRegressions++; |
1068 | 1068 | report << "REGRESSION:" << i << ":" |
1069 | | << queryName.file_string() << std::endl; |
| 1069 | << queryName.string() << std::endl; |
1070 | 1070 | } |
1071 | 1071 | else if (!haveKnownFailures) |
1072 | 1072 | { |
1073 | | report << i << ":" << queryName.file_string() << std::endl; |
| 1073 | report << i << ":" << queryName.string() << std::endl; |
1074 | 1074 | } |
1075 | 1075 | } |
1076 | 1076 | else |
… |
… |
|
1079 | 1079 | { |
1080 | 1080 | numProgressions++; |
1081 | 1081 | report << "Progression:" << i << ":" |
1082 | | << queryName.file_string() << std::endl; |
| 1082 | << queryName.string() << std::endl; |
1083 | 1083 | } |
1084 | 1084 | } |
1085 | 1085 | if(generateW3CData) |
1086 | 1086 | { |
1087 | 1087 | 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; |
1089 | 1089 | } |
1090 | 1090 | } |
1091 | 1091 | |