| Index: third_party/protobuf/src/google/protobuf/testing/googletest.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/testing/googletest.cc b/third_party/protobuf/src/google/protobuf/testing/googletest.cc
|
| index a8da6b1d129987ae359d543c68c62553e5d1f903..b8bd790b668362921efbd8f9e553f9ad3d579dda 100644
|
| --- a/third_party/protobuf/src/google/protobuf/testing/googletest.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/testing/googletest.cc
|
| @@ -1,6 +1,6 @@
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// http://code.google.com/p/protobuf/
|
| +// https://developers.google.com/protocol-buffers/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -65,7 +65,15 @@ namespace protobuf {
|
| #endif
|
|
|
| string TestSourceDir() {
|
| -#ifdef _MSC_VER
|
| +#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
|
| +#ifndef _MSC_VER
|
| + // automake sets the "srcdir" environment variable.
|
| + char* result = getenv("srcdir");
|
| + if (result != NULL) {
|
| + return result;
|
| + }
|
| +#endif // _MSC_VER
|
| +
|
| // Look for the "src" directory.
|
| string prefix = ".";
|
|
|
| @@ -79,15 +87,8 @@ string TestSourceDir() {
|
| }
|
| return prefix + "/src";
|
| #else
|
| - // automake sets the "srcdir" environment variable.
|
| - char* result = getenv("srcdir");
|
| - if (result == NULL) {
|
| - // Otherwise, the test must be run from the source directory.
|
| - return ".";
|
| - } else {
|
| - return result;
|
| - }
|
| -#endif
|
| + return "third_party/protobuf/src";
|
| +#endif // GOOGLE_THIRD_PARTY_PROTOBUF
|
| }
|
|
|
| namespace {
|
| @@ -104,6 +105,10 @@ string GetTemporaryDirectoryName() {
|
| if (HasPrefixString(result, "\\")) {
|
| result.erase(0, 1);
|
| }
|
| + // The Win32 API accepts forward slashes as a path delimiter even though
|
| + // backslashes are standard. Let's avoid confusion and use only forward
|
| + // slashes.
|
| + result = StringReplace(result, "\\", "/", true);
|
| #endif // _WIN32
|
| return result;
|
| }
|
|
|