aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/compatibility/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/tools/compatibility/BUILD')
-rw-r--r--tensorflow/tools/compatibility/BUILD57
1 files changed, 57 insertions, 0 deletions
diff --git a/tensorflow/tools/compatibility/BUILD b/tensorflow/tools/compatibility/BUILD
index b7bfb29aae..55792c51fe 100644
--- a/tensorflow/tools/compatibility/BUILD
+++ b/tensorflow/tools/compatibility/BUILD
@@ -8,10 +8,17 @@ load(
"tf_cc_test", # @unused
)
+py_library(
+ name = "ast_edits",
+ srcs = ["ast_edits.py"],
+ srcs_version = "PY2AND3",
+)
+
py_binary(
name = "tf_upgrade",
srcs = ["tf_upgrade.py"],
srcs_version = "PY2AND3",
+ deps = [":ast_edits"],
)
py_test(
@@ -26,6 +33,28 @@ py_test(
],
)
+py_binary(
+ name = "tf_upgrade_v2",
+ srcs = [
+ "renames_v2.py",
+ "tf_upgrade_v2.py",
+ ],
+ srcs_version = "PY2AND3",
+ deps = [":ast_edits"],
+)
+
+py_test(
+ name = "tf_upgrade_v2_test",
+ srcs = ["tf_upgrade_v2_test.py"],
+ srcs_version = "PY2AND3",
+ deps = [
+ ":tf_upgrade_v2",
+ "//tensorflow/python:client_testlib",
+ "//tensorflow/python:framework_test_lib",
+ "@six_archive//:six",
+ ],
+)
+
# Keep for reference, this test will succeed in 0.11 but fail in 1.0
# py_test(
# name = "test_file_v0_11",
@@ -62,9 +91,37 @@ py_test(
],
)
+genrule(
+ name = "generate_upgraded_file_v2",
+ testonly = 1,
+ srcs = ["testdata/test_file_v1_10.py"],
+ outs = [
+ "test_file_v2_0.py",
+ "report_v2.txt",
+ ],
+ cmd = ("$(location :tf_upgrade_v2)" +
+ " --infile $(location testdata/test_file_v1_10.py)" +
+ " --outfile $(location test_file_v2_0.py)" +
+ " --reportfile $(location report_v2.txt)"),
+ tools = [":tf_upgrade_v2"],
+)
+
+py_test(
+ name = "test_file_v2_0",
+ size = "small",
+ srcs = ["test_file_v2_0.py"],
+ srcs_version = "PY2AND3",
+ deps = [
+ "//tensorflow:tensorflow_py",
+ ],
+)
+
exports_files(
[
+ "ast_edits.py",
"tf_upgrade.py",
+ "renames_v2.py",
"testdata/test_file_v0_11.py",
+ "testdata/test_file_v1_10.py",
],
)