Skip to content

Instantly share code, notes, and snippets.

@bgogul
Last active January 13, 2022 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgogul/5d731bf62cff5fe4e53fccb71eb20aa8 to your computer and use it in GitHub Desktop.
Save bgogul/5d731bf62cff5fe4e53fccb71eb20aa8 to your computer and use it in GitHub Desktop.
namespace raksha::test_utils {
std::filesystem::path GetTestDataDir(std::string path) {
absl::string_view test_srcdir_env = std::getenv("TEST_SRCDIR");
absl::string_view test_workspace_env = std::getenv("TEST_WORKSPACE");
CHECK(test_srcdir_env != "");
CHECK(test_workspace_env != "");
return std::filesystem::path(test_srcdir_env) /
std::filesystem::path(test_workspace_env) / std::move(path);
}
}
GetTestDataDir("src/xform_to_datalog/testdata")
GetTestDataDir("src/some/other/target/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment