CMakeLists.txt 3.4 KB
Newer Older
Z
zhangjinchao01 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# gserver pacakge unittests

################### test_ProtoDataProvider ############
add_unittest_without_exec(test_ProtoDataProvider
    test_ProtoDataProvider.cpp
    TestUtil.cpp)

# test_ProtoDataProvider will mkdir as same name,
# so if WORKING_DIRECTORY is default directory, then
# mkdir will get error.
add_test(NAME test_ProtoDataProvider
    COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_ProtoDataProvider
    WORKING_DIRECTORY ${PROJ_ROOT}/paddle)

################# test_LayerGrad #######################
add_unittest_without_exec(test_LayerGrad
    test_LayerGrad.cpp
    LayerGradUtil.cpp
    TestUtil.cpp)
add_test(NAME test_LayerGrad
21
    COMMAND test_LayerGrad)
Z
zhangjinchao01 已提交
22

23 24 25 26 27 28
add_unittest_without_exec(test_ActivationGrad
    test_ActivationGrad.cpp
    LayerGradUtil.cpp
    TestUtil.cpp)
add_test(NAME test_ActivationGrad
    COMMAND test_ActivationGrad)
29 30 31 32 33 34 35 36
################# test_ConvTrans #######################
add_unittest_without_exec(test_ConvTrans
    test_ConvTrans.cpp
    LayerGradUtil.cpp
    TestUtil.cpp)

add_test(NAME test_ConvTrans
    COMMAND test_ConvTrans)
37

Z
zhangjinchao01 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
################## test_Evaluator #######################
add_unittest(test_Evaluator
    test_Evaluator.cpp
    TestUtil.cpp)

################ test_LinearChainCRF ####################
add_simple_unittest(test_LinearChainCRF)

############## test_MultinomialSampler ###################
add_simple_unittest(test_MultinomialSampler)

############## test_PyDataProvider ########################
if(WITH_PYTHON)
    add_unittest_without_exec(test_PyDataProvider
        test_PyDataProvider.cpp
        TestUtil.cpp)

    add_test(NAME test_PyDataProvider
        COMMAND .set_python_path.sh -d ./gserver/tests:${PROJ_ROOT}/python/ ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider
        WORKING_DIRECTORY ${PROJ_ROOT}/paddle)
endif()

############### test_RecurrentLayer #######################
add_unittest(test_RecurrentLayer
    test_RecurrentLayer.cpp
    TestUtil.cpp)

65 66 67 68 69 70 71
############### test_WarpCTCLayer #######################
if(NOT WITH_DOUBLE)
    add_unittest(test_WarpCTCLayer
        test_WarpCTCLayer.cpp
        TestUtil.cpp)
endif()

Z
zhangjinchao01 已提交
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
############### test_RecurrentGradientMachine ###############
# TODO(yuyang18): There is some bug in test_RecurrentGradientMachine
# I will fix it.
add_unittest_without_exec(test_RecurrentGradientMachine
    test_RecurrentGradientMachine.cpp)
add_test(NAME test_RecurrentGradientMachine
    COMMAND .set_python_path.sh -d
            ${PROJ_ROOT}/python:${PROJ_ROOT}/paddle/gserver/tests
            ${CMAKE_CURRENT_BINARY_DIR}/test_RecurrentGradientMachine
    WORKING_DIRECTORY ${PROJ_ROOT}/paddle)

add_unittest_without_exec(test_NetworkCompare
    test_NetworkCompare.cpp
    TestUtil.cpp)
if(WITH_GPU)
    add_test(NAME test_NetworkCompare
        COMMAND .set_python_path.sh -d ${PROJ_ROOT}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=true
        WORKING_DIRECTORY ${PROJ_ROOT}/paddle)
else()
    add_test(NAME test_NetworkCompare
        COMMAND .set_python_path.sh -d ${PROJ_ROOT}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=false
        WORKING_DIRECTORY ${PROJ_ROOT}/paddle)
endif()


add_unittest_without_exec(test_PyDataProvider2
        test_PyDataProvider2.cpp)

add_test(NAME test_PyDataProvider2
   COMMAND .set_python_path.sh -d ${PROJ_ROOT}/paddle/gserver/tests:${PROJ_ROOT}/python ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider2
        WORKING_DIRECTORY ${PROJ_ROOT}/paddle
)