提交 7ecdf6ad 编写于 作者: L liaogang

Add py_test

上级 2f9c443b
...@@ -403,3 +403,16 @@ function(py_proto_compile TARGET_NAME) ...@@ -403,3 +403,16 @@ function(py_proto_compile TARGET_NAME)
protobuf_generate_python(py_srcs ${py_proto_compile_SRCS}) protobuf_generate_python(py_srcs ${py_proto_compile_SRCS})
add_custom_target(${TARGET_NAME} ALL DEPENDS ${py_srcs}) add_custom_target(${TARGET_NAME} ALL DEPENDS ${py_srcs})
endfunction() endfunction()
function(py_test TARGET_NAME)
if(WITH_TESTING)
set(options STATIC static SHARED shared)
set(oneValueArgs "")
set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_test(NAME ${TARGET_NAME}
COMMAND env PYTHONPATH=${PADDLE_PYTHON_PACKAGE_DIR}
python2 ${py_test_SRCS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endfunction()
add_python_test(test_swig_api py_test(testTrain SRCS testTrain.py)
testArguments.py testGradientMachine.py testMatrix.py testVector.py testTrain.py testTrainer.py) py_test(testMatrix SRCS testMatrix.py)
py_test(testVector SRCS testVector.py)
py_test(testTrainer SRCS testTrainer.py)
py_test(testArguments SRCS testArguments.py)
py_test(testGradientMachine SRCS testGradientMachine.py)
add_python_test(test_framework py_test(test_net SRCS test_net.py)
test_protobuf.py
test_scope.py py_test(test_fc_op SRCS test_fc_op.py)
test_default_scope_funcs.py py_test(test_scope SRCS test_scope.py)
test_op_creation_methods.py
test_net.py py_test(test_tensor SRCS test_tensor.py)
test_tensor.py py_test(test_mul_op SRCS test_mul_op.py)
test_fc_op.py
test_add_two_op.py py_test(test_network SRCS test_network.py)
test_sgd_op.py py_test(test_mean_op SRCS test_mean_op.py)
test_mul_op.py
test_mean_op.py py_test(test_protobuf SRCS test_protobuf.py)
test_sigmoid_op.py
test_softmax_op.py py_test(test_add_two_op SRCS test_add_two_op.py)
test_rowwise_add_op.py py_test(test_sigmoid_op SRCS test_sigmoid_op.py)
test_network.py py_test(test_softmax_op SRCS test_softmax_op.py)
gradient_checker.py)
py_test(gradient_checker SRCS gradient_checker.py)
py_test(test_rowwise_add_op SRCS test_rowwise_add_op.py)
py_test(test_default_scope_funcs SRCS test_default_scope_funcs.py)
py_test(test_op_creation_methods SRCS test_op_creation_methods.py)
if (NOT APPLE) if (NOT APPLE)
# The Mac OS X backend will not be able to function correctly if Python is # The Mac OS X backend will not be able to function correctly if Python is
# not installed as a framework. # not installed as a framework.
add_python_test(test_ploter test_ploter.py) py_test(test_ploter SRCS test_ploter.py)
endif() endif()
add_python_test(reader_tests creator_test.py decorator_test.py) py_test(creator_test SRCS creator_test.py)
py_test(decorator_test SRCS decorator_test.py)
add_python_test(test_v2_api test_data_feeder.py test_op.py test_parameters.py py_test(test_op SRCS test_op.py)
test_layer.py test_rnn_layer.py test_topology.py test_image.py) py_test(test_image SRCS test_image.py)
py_test(test_layer SRCS test_layer.py)
py_test(test_topology SRCS test_topology.py)
py_test(test_rnn_layer SRCS test_rnn_layer.py)
py_test(test_parameters SRCS test_parameters.py)
py_test(test_data_feeder SRCS test_data_feeder.py)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册