CMakeLists.txt 1.2 KB
Newer Older
1 2 3 4 5 6 7
function(inference_test TARGET_NAME)
  set(options "")
  set(oneValueArgs "")
  set(multiValueArgs ARGS)
  cmake_parse_arguments(inference_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

  set(PYTHON_TESTS_DIR ${PADDLE_SOURCE_DIR}/python/paddle/v2/fluid/tests)
L
Liu Yiqun 已提交
8
  set(arg_list "")
9 10
  if(inference_test_ARGS)
    foreach(arg ${inference_test_ARGS})
L
Liu Yiqun 已提交
11
      list(APPEND arg_list "_${arg}")
12 13
    endforeach()
  else()
L
Liu Yiqun 已提交
14 15 16 17 18
    list(APPEND arg_list "_")
  endif()
  foreach(arg ${arg_list})
    string(REGEX REPLACE "^_$" "" arg "${arg}")
    cc_test(test_inference_${TARGET_NAME}${arg}
19 20
        SRCS test_inference_${TARGET_NAME}.cc
        DEPS ARCHIVE_START paddle_fluid ARCHIVE_END
L
Liu Yiqun 已提交
21 22
        ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}${arg}.inference.model)
    set_tests_properties(test_inference_${TARGET_NAME}${arg}
23
        PROPERTIES DEPENDS test_${TARGET_NAME})
L
Liu Yiqun 已提交
24
  endforeach()
25 26
endfunction(inference_test)

27
inference_test(fit_a_line)
28 29
inference_test(image_classification ARGS vgg resnet)
inference_test(label_semantic_roles)
30
inference_test(recognize_digits ARGS mlp)
31
inference_test(recommender_system)
Y
Yu Yang 已提交
32
#inference_test(rnn_encoder_decoder)
L
Liu Yiqun 已提交
33
inference_test(understand_sentiment ARGS conv lstm)
34
inference_test(word2vec)