arrow::Result FindTestDataFile()

in cpp/code/common.cc [163:175]


arrow::Result<std::string> FindTestDataFile(const std::string& test_data_name) {
  auto path_iter = std::filesystem::current_path();
  while (path_iter.has_parent_path()) {
    auto test_data_dir_path = path_iter / "testdata";
    if (std::filesystem::exists(test_data_dir_path)) {
      return (test_data_dir_path / test_data_name).string();
    }
    path_iter = path_iter.parent_path();
  }
  return arrow::Status::Invalid(
      "Could not locate testdata directory.  Tests must be "
      "run inside of the cookbook repo");
}