Merge pull request #21139 from Androbin:exists

PiperOrigin-RevId: 208001936
This commit is contained in:
TensorFlower Gardener 2018-08-08 23:57:23 -07:00
commit 4ff625bc58

View File

@ -122,6 +122,17 @@ function(AddPythonTests)
endforeach()
endfunction(AddPythonTests)
#
# ensure that every element is an existing file
#
function(CheckExists TYPE SOURCES)
foreach(source ${SOURCES})
if(NOT EXISTS ${source})
message(SEND_ERROR "${TYPE} not found: ${source}")
endif()
endforeach(source)
endfunction(CheckExists)
if (tensorflow_BUILD_PYTHON_TESTS)
#
# python tests. This assumes that the tensorflow wheel is
@ -145,7 +156,6 @@ if (tensorflow_BUILD_PYTHON_TESTS)
"${tensorflow_source_dir}/tensorflow/python/debug/wrappers/*_test.py"
"${tensorflow_source_dir}/tensorflow/contrib/estimator/python/estimator/*_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/*.py"
"${tensorflow_source_dir}/tensorflow/python/meta_graph_transform/*_test.py"
"${tensorflow_source_dir}/tensorflow/python/ops/quantized_conv_ops_test.py"
"${tensorflow_source_dir}/tensorflow/python/ops/quantized_ops_test.py"
"${tensorflow_source_dir}/tensorflow/python/platform/build_info_test.py"
@ -198,7 +208,6 @@ if (tensorflow_BUILD_PYTHON_TESTS)
"${tensorflow_source_dir}/tensorflow/python/saved_model/saved_model_test.py"
"${tensorflow_source_dir}/tensorflow/contrib/image/python/kernel_tests/sparse_image_warp_test.py"
# requires scipy
"${tensorflow_source_dir}/tensorflow/contrib/keras/python/keras/preprocessing/*_test.py"
"${tensorflow_source_dir}/tensorflow/contrib/tfprof/python/tools/tfprof/pprof_profiler_test.py"
"${tensorflow_source_dir}/tensorflow/contrib/image/python/kernel_tests/interpolate_spline_test.py"
# Takes very long to run without sharding (defined in bazel build file).
@ -256,10 +265,9 @@ if (tensorflow_BUILD_PYTHON_TESTS)
# Flaky because of local cluster creation.
"${tensorflow_source_dir}/tensorflow/python/training/sync_replicas_optimizer_test.py"
"${tensorflow_source_dir}/tensorflow/python/debug/lib/session_debug_grpc_test.py"
"${tensorflow_source_dir}tensorflow/python/training/localhost_cluster_performance_test.py"
"${tensorflow_source_dir}/tensorflow/python/training/localhost_cluster_performance_test.py"
"${tensorflow_source_dir}/tensorflow/python/data/kernel_tests/iterator_ops_cluster_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/functional_ops_test.py"
"${tensorflow_source_dir}/tensorflow/contrib/data/python/kernel_tests/iterator_ops_cluster_test.py"
# Type error in testRemoteIteratorUsingRemoteCallOpDirectSessionGPUCPU.
"${tensorflow_source_dir}/tensorflow/python/data/kernel_tests/iterator_ops_test.py"
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py"
@ -329,6 +337,7 @@ if (tensorflow_BUILD_PYTHON_TESTS)
"${tensorflow_source_dir}/tensorflow/python/keras/_impl/keras/utils/io_utils_test.py" # b/72894325
)
endif()
CheckExists(${tf_test_src_py_exclude})
list(REMOVE_ITEM tf_test_src_py ${tf_test_src_py_exclude})
AddPythonTests(
@ -480,6 +489,7 @@ if (tensorflow_BUILD_CC_TESTS)
"${tensorflow_source_dir}/tensorflow/cc/saved_model/*_test.cc"
)
CheckExists(${tf_test_src_simple_exclude})
list(REMOVE_ITEM tf_test_src_simple
${tf_test_src_simple_exclude}
${tf_cc_saved_model_test_srcs}
@ -494,6 +504,7 @@ if (tensorflow_BUILD_CC_TESTS)
${tf_core_profiler_test_srcs}
)
CheckExists(${tf_src_testlib})
set(tf_test_lib tf_test_lib)
add_library(${tf_test_lib} STATIC ${tf_src_testlib})