Commit 46bd60b9 authored by Bo Yang's avatar Bo Yang

Modify directory to use in test

Change-Id: Iede1dc4e70427663e0d3c5304fa86b3aebf492b7
parent 9a121853
...@@ -288,6 +288,7 @@ void CommandLineInterfaceTest::Run(const string& command) { ...@@ -288,6 +288,7 @@ void CommandLineInterfaceTest::Run(const string& command) {
if (!disallow_plugins_) { if (!disallow_plugins_) {
cli_.AllowPlugins("prefix-"); cli_.AllowPlugins("prefix-");
#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
const char* possible_paths[] = { const char* possible_paths[] = {
// When building with shared libraries, libtool hides the real executable // When building with shared libraries, libtool hides the real executable
// in .libs and puts a fake wrapper in the current directory. // in .libs and puts a fake wrapper in the current directory.
...@@ -316,6 +317,11 @@ void CommandLineInterfaceTest::Run(const string& command) { ...@@ -316,6 +317,11 @@ void CommandLineInterfaceTest::Run(const string& command) {
} }
if (plugin_path.empty()) { 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) GOOGLE_LOG(ERROR)
<< "Plugin executable not found. Plugin tests are likely to fail."; << "Plugin executable not found. Plugin tests are likely to fail.";
} else { } else {
......
...@@ -65,6 +65,7 @@ namespace protobuf { ...@@ -65,6 +65,7 @@ namespace protobuf {
#endif #endif
string TestSourceDir() { string TestSourceDir() {
#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
#ifdef _MSC_VER #ifdef _MSC_VER
// Look for the "src" directory. // Look for the "src" directory.
string prefix = "."; string prefix = ".";
...@@ -88,6 +89,9 @@ string TestSourceDir() { ...@@ -88,6 +89,9 @@ string TestSourceDir() {
return result; return result;
} }
#endif #endif
#else
return "third_party/protobuf/src";
#endif // GOOGLE_THIRD_PARTY_PROTOBUF
} }
namespace { namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment