aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc6
-rw-r--r--src/google/protobuf/testing/googletest.cc4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
index a2cbbdc6..e284c791 100644
--- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
@@ -288,6 +288,7 @@ void CommandLineInterfaceTest::Run(const string& command) {
if (!disallow_plugins_) {
cli_.AllowPlugins("prefix-");
+#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
const char* possible_paths[] = {
// When building with shared libraries, libtool hides the real executable
// in .libs and puts a fake wrapper in the current directory.
@@ -316,6 +317,11 @@ void CommandLineInterfaceTest::Run(const string& command) {
}
if (plugin_path.empty()) {
+#else
+ string plugin_path = "third_party/protobuf/test_plugin";
+
+ if (access(plugin_path.c_str(), F_OK) != 0) {
+#endif // GOOGLE_THIRD_PARTY_PROTOBUF
GOOGLE_LOG(ERROR)
<< "Plugin executable not found. Plugin tests are likely to fail.";
} else {
diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc
index d72fa5c0..5f6a199a 100644
--- a/src/google/protobuf/testing/googletest.cc
+++ b/src/google/protobuf/testing/googletest.cc
@@ -65,6 +65,7 @@ namespace protobuf {
#endif
string TestSourceDir() {
+#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
#ifdef _MSC_VER
// Look for the "src" directory.
string prefix = ".";
@@ -88,6 +89,9 @@ string TestSourceDir() {
return result;
}
#endif
+#else
+ return "third_party/protobuf/src";
+#endif // GOOGLE_THIRD_PARTY_PROTOBUF
}
namespace {