Correct test data path for internal test runs
@@ -25,9 +25,11 @@ using namespace facebook::presto;
namespace {
std::string getDataPath(const std::string& fileName) {
+ static const std::string kFbcode = "fbcode";
+
std::string currentPath = fs::current_path().c_str();
- if (boost::algorithm::ends_with(currentPath, "fbcode")) {
- return currentPath + "/presto_cpp/presto_protocol/tests/data/" + fileName;
+ if (boost::algorithm::ends_with(currentPath, kFbcode)) {
+ return currentPath.substr(0, currentPath.length() - kFbcode.length()) + "third-party/presto_cpp/presto_protocol/tests/data/" + fileName;
}
if (boost::algorithm::ends_with(currentPath, "fbsource")) {
