CMakeLists.txt 4.7 KB
Newer Older
Z
zhangjinchao01 已提交
1 2
# gserver pacakge unittests

X
xuwei06 已提交
3 4 5 6 7
file(GLOB_RECURSE GSERVER_HEADER RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
file(GLOB_RECURSE GSERVER_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cpp")
add_style_check_target(paddle_gserver ${GSERVER_SOURCES})
add_style_check_target(paddle_gserver ${GSERVER_HEADER})

Z
zhangjinchao01 已提交
8 9
################### test_ProtoDataProvider ############
add_unittest_without_exec(test_ProtoDataProvider
10
    test_ProtoDataProvider.cpp)
Z
zhangjinchao01 已提交
11 12 13 14 15 16 17 18 19 20 21

# 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
22
    LayerGradUtil.cpp)
Z
zhangjinchao01 已提交
23
add_test(NAME test_LayerGrad
24
    COMMAND test_LayerGrad)
Z
zhangjinchao01 已提交
25

26 27 28
################ test_CRFLayerGrad ####################
add_unittest_without_exec(test_CRFLayerGrad
    test_CRFLayerGrad.cpp
P
Peng Li 已提交
29
    LayerGradUtil.cpp)
30 31 32 33
add_test(NAME test_CRFLayerGrad
    COMMAND test_CRFLayerGrad)


34 35
add_unittest_without_exec(test_ActivationGrad
    test_ActivationGrad.cpp
36
    LayerGradUtil.cpp)
37 38
add_test(NAME test_ActivationGrad
    COMMAND test_ActivationGrad)
39 40 41
################# test_ConvTrans #######################
add_unittest_without_exec(test_ConvTrans
    test_ConvTrans.cpp
42
    LayerGradUtil.cpp)
43 44 45

add_test(NAME test_ConvTrans
    COMMAND test_ConvTrans)
G
gaoyuan 已提交
46 47 48
################# test_PriorBox #######################
add_unittest_without_exec(test_PriorBox
    test_PriorBox.cpp
49
    LayerGradUtil.cpp)
G
gaoyuan 已提交
50 51 52

add_test(NAME test_PriorBox
    COMMAND test_PriorBox)
53 54 55 56 57
################# test_DetectionOutput #######################
add_unittest_without_exec(test_DetectionOutput
    test_DetectionOutput.cpp
    LayerGradUtil.cpp)

X
xuwei06 已提交
58
add_test(NAME test_DetectionOutput
59
    COMMAND test_DetectionOutput)
W
wangyang59 已提交
60 61 62
################# test_ConvUnify #######################
add_unittest_without_exec(test_ConvUnify
    test_ConvUnify.cpp
63
    LayerGradUtil.cpp)
64

W
wangyang59 已提交
65 66
add_test(NAME test_ConvUnify
    COMMAND test_ConvUnify)
67 68 69
################# test_BatchNorm #######################
add_unittest_without_exec(test_BatchNorm
    test_BatchNorm.cpp
70
    LayerGradUtil.cpp)
71 72 73

add_test(NAME test_BatchNorm
    COMMAND test_BatchNorm)
Z
zhangjinchao01 已提交
74 75
################## test_Evaluator #######################
add_unittest(test_Evaluator
76
    test_Evaluator.cpp)
Z
zhangjinchao01 已提交
77 78 79 80 81 82 83 84 85 86

################ 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
87
        test_PyDataProvider.cpp)
Z
zhangjinchao01 已提交
88 89 90 91 92 93 94

    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 #######################
95
add_simple_unittest(test_RecurrentLayer)
Z
zhangjinchao01 已提交
96

97 98
############### test_WarpCTCLayer #######################
if(NOT WITH_DOUBLE)
99
    add_unittest_without_exec(test_WarpCTCLayer
100
        test_WarpCTCLayer.cpp)
101 102

    add_test(NAME test_WarpCTCLayer
L
liaogang 已提交
103
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer --warpctc_dir=${WARPCTC_LIB_DIR}
104
        WORKING_DIRECTORY ${PROJ_ROOT}/paddle)
105 106
endif()

Z
zhangjinchao01 已提交
107 108 109 110 111 112 113 114 115 116 117 118
############### 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
119
    test_NetworkCompare.cpp)
Z
zhangjinchao01 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
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
)