aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api_test.cc
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2016-11-14 15:54:33 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-14 16:08:54 -0800
commita374ea13c0c7b9598b5ada851b43655f895a578e (patch)
tree0eff063ac40e04115ce5c630ddf02ddbf69abe94 /tensorflow/c/c_api_test.cc
parent33c61f3e5a92c371785864b14ce97386d65ade3b (diff)
C API: Add TF_Version(), akin to __version__ in python.
Since we envision a binary release of the C-library and other language bindings linking against it, will be useful to have version information when any debugging needs to be done. There is a slight problem in that TF_VERSION_STRING will point to the latest release when compiled from source at HEAD - which might be confusing as the version string will not represent true state of the libraries. But that seems like something to be dealt with in version.h independently of exporting this TF_Version() function. While at it, make the version string accessible in the Go API. TensorFlow follows semantic versioning, but parsing the version string into MAJOR, MINOR and PATCH is left as an excercise to the user (who can use any number of semantic version parsing libraries out there). Change: 139132778
Diffstat (limited to 'tensorflow/c/c_api_test.cc')
-rw-r--r--tensorflow/c/c_api_test.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/c/c_api_test.cc b/tensorflow/c/c_api_test.cc
index 2b46c6f1e6..ca1324033d 100644
--- a/tensorflow/c/c_api_test.cc
+++ b/tensorflow/c/c_api_test.cc
@@ -45,6 +45,8 @@ TF_Tensor* TF_Tensor_EncodeStrings(const Tensor& src);
namespace {
+TEST(CAPI, Version) { EXPECT_NE("", string(TF_Version())); }
+
TEST(CAPI, Status) {
TF_Status* s = TF_NewStatus();
EXPECT_EQ(TF_OK, TF_GetCode(s));