generic.cc 484 B

12345678910111213141516171819202122
  1. #include "dragnn/core/test/generic.h"
  2. #include "tensorflow/core/lib/io/path.h"
  3. namespace syntaxnet {
  4. namespace test {
  5. string GetTestDataPrefix() {
  6. const char *env = getenv("TEST_SRCDIR");
  7. const char *workspace = getenv("TEST_WORKSPACE");
  8. if (!env || env[0] == '\0' || !workspace || workspace[0] == '\0') {
  9. LOG(FATAL) << "Test directories not set up";
  10. }
  11. return tensorflow::io::JoinPath(
  12. env, workspace
  13. );
  14. }
  15. } // namespace test
  16. } // namespace syntaxnet