Remove explicit static linking from tests that load a shared library.

This was causing the .so files to have undefined symbols from core/framework.
Change: 145479847
This commit is contained in:
Suharsh Sivakumar 2017-01-24 15:58:55 -08:00 committed by gunan
parent 9d01b154aa
commit debc40442f
4 changed files with 16 additions and 6 deletions

View File

@ -84,7 +84,9 @@ tf_cc_test(
"//tensorflow:darwin": ["-headerpad_max_install_names"],
"//conditions:default": [],
}),
linkstatic = tf_kernel_tests_linkstatic(),
# We must ensure that the dependencies can be dynamically linked since
# the shared library must be able to use core:framework.
# linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":c_api",
"//tensorflow/cc/saved_model:signature_constants",

View File

@ -241,7 +241,9 @@ tf_cc_test(
size = "small",
srcs = ["ops/gru_ops_test.cc"],
data = [":python/ops/_gru_ops.so"],
linkstatic = tf_kernel_tests_linkstatic(),
# We must ensure that the dependencies can be dynamically linked since
# the shared library must be able to use core:framework.
# linkstatic = tf_kernel_tests_linkstatic(),
deps = [
"//tensorflow/c:c_api",
"//tensorflow/core:framework",
@ -258,7 +260,9 @@ tf_cc_test(
size = "small",
srcs = ["ops/lstm_ops_test.cc"],
data = [":python/ops/_lstm_ops.so"],
linkstatic = tf_kernel_tests_linkstatic(),
# We must ensure that the dependencies can be dynamically linked since
# the shared library must be able to use core:framework.
# linkstatic = tf_kernel_tests_linkstatic(),
deps = [
"//tensorflow/c:c_api",
"//tensorflow/core:framework",

View File

@ -27,8 +27,10 @@ class GruOpsTest : public ::testing::Test {
TF_Status* status = TF_NewStatus();
auto* lib = TF_LoadLibrary(
"tensorflow/contrib/rnn/python/ops/_gru_ops.so", status);
CHECK_EQ(TF_OK, TF_GetCode(status));
TF_Code code = TF_GetCode(status);
string status_msg(TF_Message(status));
TF_DeleteStatus(status);
ASSERT_EQ(TF_OK, code) << status_msg;
TF_DeleteLibraryHandle(lib);
}
};

View File

@ -29,9 +29,11 @@ class LSTMOpsTest : public ::testing::Test {
TF_Status* status = TF_NewStatus();
auto* lib = TF_LoadLibrary(
"tensorflow/contrib/rnn/python/ops/_lstm_ops.so", status);
CHECK_EQ(TF_OK, TF_GetCode(status));
TF_DeleteLibraryHandle(lib);
TF_Code code = TF_GetCode(status);
string status_msg(TF_Message(status));
TF_DeleteStatus(status);
ASSERT_EQ(TF_OK, code) << status_msg;
TF_DeleteLibraryHandle(lib);
}
};