diff options
Diffstat (limited to 'java/core/src/test/java/com/google/protobuf/TestUtil.java')
-rw-r--r-- | java/core/src/test/java/com/google/protobuf/TestUtil.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/core/src/test/java/com/google/protobuf/TestUtil.java b/java/core/src/test/java/com/google/protobuf/TestUtil.java index 08b2a76d..d94f99e3 100644 --- a/java/core/src/test/java/com/google/protobuf/TestUtil.java +++ b/java/core/src/test/java/com/google/protobuf/TestUtil.java @@ -3764,7 +3764,8 @@ public final class TestUtil { private static File getTestDataDir() { // Search each parent directory looking for "src/google/protobuf". - File ancestor = new File("."); + File ancestor = new File(System.getProperty("protobuf.dir", ".")); + String initialPath = ancestor.getAbsolutePath(); try { ancestor = ancestor.getCanonicalFile(); } catch (IOException e) { @@ -3781,7 +3782,7 @@ public final class TestUtil { throw new RuntimeException( "Could not find golden files. This test must be run from within the " + "protobuf source package so that it can read test data files from the " + - "C++ source tree."); + "C++ source tree: " + initialPath); } /** |