CMakeLists.txt 5.2 KB
Newer Older
Z
zhangjinchao01 已提交
1 2 3 4
################# test_Compare ############################
add_unittest_without_exec(test_Compare
    test_Compare.cpp)
add_test(NAME test_Compare
5
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python
Z
zhangjinchao01 已提交
6
        ${CMAKE_CURRENT_BINARY_DIR}/test_Compare
7
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
8 9 10 11 12

################# test_Trainer ###########################
add_unittest_without_exec(test_Trainer
    test_Trainer.cpp)
add_test(NAME test_Trainer
13 14 15
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
        ${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/paddle/trainer/tests/gen_proto_data.py &&
        ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
Z
zhangjinchao01 已提交
16
        ${CMAKE_CURRENT_BINARY_DIR}/test_Trainer
17
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
18 19

############### test_TrainerOnePass ##########################
20 21 22 23 24 25
if(WITH_PYTHON)
  # only run test_TrainerOnePass when PYTHON is enabled, because train one pass
  # is using PyDataProvider2.
  add_unittest_without_exec(test_TrainerOnePass
      test_TrainerOnePass.cpp)
  add_test(NAME test_TrainerOnePass
26 27 28 29
    COMMAND  ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d
          ${PADDLE_SOURCE_DIR}/python/:${PADDLE_SOURCE_DIR}/paddle/trainer/tests
          ${PADDLE_SOURCE_DIR}/paddle/.set_port.sh -p port ${CMAKE_CURRENT_BINARY_DIR}/test_TrainerOnePass
      WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
30
endif()
Z
zhangjinchao01 已提交
31 32 33 34
################ test_CompareTwoNets ######################
add_unittest_without_exec(test_CompareTwoNets
    test_CompareTwoNets.cpp)
add_test(NAME test_CompareTwoNets
35
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
Z
zhangjinchao01 已提交
36 37
        ${CMAKE_CURRENT_BINARY_DIR}/test_CompareTwoNets
            --config_file_a=trainer/tests/sample_trainer_config_qb_rnn.conf --config_file_b=trainer/tests/sample_trainer_config_rnn.conf
38
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
39

40 41 42 43 44 45 46 47 48 49 50
################ test_CompareMKLDNNandCPU ######################
if(WITH_MKLDNN)
  add_unittest_without_exec(test_CompareMKLDNNandCPU
      test_CompareTwoNets.cpp)
  add_test(NAME test_CompareMKLDNNandCPU
    COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
          ${CMAKE_CURRENT_BINARY_DIR}/test_CompareMKLDNNandCPU
              --config_file_a=trainer/tests/sample_trainer_config_simple_net.conf --use_mkldnn_a=True
              --config_file_b=trainer/tests/sample_trainer_config_simple_net.conf --use_mkldnn_b=False
              --use_gpu=False
      WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
51 52 53 54 55 56 57
  add_test(NAME test_CompareMKLDNNandCPU_Banches
    COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
          ${CMAKE_CURRENT_BINARY_DIR}/test_CompareMKLDNNandCPU
              --config_file_a=trainer/tests/sample_trainer_config_branch_net.conf --use_mkldnn_a=True
              --config_file_b=trainer/tests/sample_trainer_config_branch_net.conf --use_mkldnn_b=False
              --use_gpu=False
      WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
58 59
endif()

Z
zhangjinchao01 已提交
60 61 62 63
############### test_CompareTwoOpts ###################
add_unittest_without_exec(test_CompareTwoOpts
    test_CompareTwoOpts.cpp)
add_test(NAME test_CompareTwoOpts
64
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
Z
zhangjinchao01 已提交
65 66
        ${CMAKE_CURRENT_BINARY_DIR}/test_CompareTwoOpts
            --config_file_a=trainer/tests/sample_trainer_config_opt_a.conf --config_file_b=trainer/tests/sample_trainer_config_opt_b.conf
67
            --num_passes=1 --need_high_accuracy=0
68
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
69 70 71 72

################# test_CompareSparse ##################
add_unittest_without_exec(test_CompareSparse
    test_CompareSparse.cpp)
Y
Yu Yang 已提交
73 74
if(NOT ON_TRAVIS)
  add_test(NAME test_CompareSparse
75
    COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
Y
Yu Yang 已提交
76 77
              ./.set_port.sh -p port -n 6
                  ${CMAKE_CURRENT_BINARY_DIR}/test_CompareSparse
78
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Y
Yu Yang 已提交
79
endif()
Z
zhangjinchao01 已提交
80 81 82 83
################# test_recurrent_machine_generation ###############
add_unittest_without_exec(test_recurrent_machine_generation
    test_recurrent_machine_generation.cpp)
add_test(NAME test_recurrent_machine_generation
84
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
Z
zhangjinchao01 已提交
85
        ${CMAKE_CURRENT_BINARY_DIR}/test_recurrent_machine_generation
86
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
87 88 89 90 91 92

#################### test_PyDataProviderWrapper #########################
add_unittest_without_exec(test_PyDataProviderWrapper
    test_PyDataProviderWrapper.cpp)

add_test(NAME test_PyDataProviderWrapper
93 94
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d
        ${PADDLE_SOURCE_DIR}/python/:${PADDLE_SOURCE_DIR}/paddle/trainer/tests
Z
zhangjinchao01 已提交
95
        ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProviderWrapper
96
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)
Z
zhangjinchao01 已提交
97 98 99

#################### test_config_parser #########################
add_test(NAME test_config_parser
100 101 102
  COMMAND ${PADDLE_SOURCE_DIR}/paddle/.set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python/
        ${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/paddle/trainer/tests/config_parser_test.py
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle/)