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

################### test_ProtoDataProvider ############
add_unittest_without_exec(test_ProtoDataProvider
5
    test_ProtoDataProvider.cpp)
Z
zhangjinchao01 已提交
6 7 8 9 10 11

# 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
12
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
13 14 15 16

################# test_LayerGrad #######################
add_unittest_without_exec(test_LayerGrad
    test_LayerGrad.cpp
17
    LayerGradUtil.cpp)
Z
zhangjinchao01 已提交
18
add_test(NAME test_LayerGrad
19
    COMMAND test_LayerGrad)
Z
zhangjinchao01 已提交
20

T
tensor-tang 已提交
21 22
########## test_Mkldnn layers and activations ##########
if(WITH_MKLDNN)
23 24 25
    add_unittest_without_exec(test_MKLDNN
        test_MKLDNN.cpp
        MKLDNNTester.cpp
T
tensor-tang 已提交
26
        LayerGradUtil.cpp)
27
    add_test(NAME test_MKLDNN COMMAND test_MKLDNN)
T
tensor-tang 已提交
28 29
endif()

30 31 32
################ test_CRFLayerGrad ####################
add_unittest_without_exec(test_CRFLayerGrad
    test_CRFLayerGrad.cpp
P
Peng Li 已提交
33
    LayerGradUtil.cpp)
34 35 36
add_test(NAME test_CRFLayerGrad
    COMMAND test_CRFLayerGrad)

C
caoying03 已提交
37 38 39 40 41 42
################ test_CrossEntropyOverBeam ####################
add_unittest_without_exec(test_CrossEntropyOverBeam
    test_CrossEntropyOverBeamGrad.cpp
    LayerGradUtil.cpp)
add_test(NAME test_CrossEntropyOverBeam
    COMMAND test_CrossEntropyOverBeam)
43

C
caoying03 已提交
44 45 46 47 48 49
################ test_SeqSliceLayerGrad ####################
add_unittest_without_exec(test_SeqSliceLayerGrad
    test_SeqSliceLayerGrad.cpp
    LayerGradUtil.cpp)
add_test(NAME test_SeqSliceLayerGrad
    COMMAND test_SeqSliceLayerGrad)
50

51 52
add_unittest_without_exec(test_ActivationGrad
    test_ActivationGrad.cpp
53
    LayerGradUtil.cpp)
54 55
add_test(NAME test_ActivationGrad
    COMMAND test_ActivationGrad)
56 57 58
################# test_ConvTrans #######################
add_unittest_without_exec(test_ConvTrans
    test_ConvTrans.cpp
59
    LayerGradUtil.cpp)
60 61 62

add_test(NAME test_ConvTrans
    COMMAND test_ConvTrans)
G
gaoyuan 已提交
63 64 65
################# test_PriorBox #######################
add_unittest_without_exec(test_PriorBox
    test_PriorBox.cpp
66
    LayerGradUtil.cpp)
G
gaoyuan 已提交
67 68 69

add_test(NAME test_PriorBox
    COMMAND test_PriorBox)
70 71 72 73 74
################# test_DetectionOutput #######################
add_unittest_without_exec(test_DetectionOutput
    test_DetectionOutput.cpp
    LayerGradUtil.cpp)

X
xuwei06 已提交
75
add_test(NAME test_DetectionOutput
76
    COMMAND test_DetectionOutput)
W
wangyang59 已提交
77 78 79
################# test_ConvUnify #######################
add_unittest_without_exec(test_ConvUnify
    test_ConvUnify.cpp
80
    LayerGradUtil.cpp)
81

W
wangyang59 已提交
82 83
add_test(NAME test_ConvUnify
    COMMAND test_ConvUnify)
84 85 86
################# test_BatchNorm #######################
add_unittest_without_exec(test_BatchNorm
    test_BatchNorm.cpp
87
    LayerGradUtil.cpp)
88 89 90

add_test(NAME test_BatchNorm
    COMMAND test_BatchNorm)
C
caoying03 已提交
91 92 93 94 95 96 97 98 99 100


################# test_KmaxSeqScore #######################
add_unittest_without_exec(test_KmaxSeqScore
    test_KmaxSeqScore.cpp
    LayerGradUtil.cpp)

add_test(NAME test_KmaxSeqScore
    COMMAND test_KmaxSeqScore)

Z
zhangjinchao01 已提交
101 102
################## test_Evaluator #######################
add_unittest(test_Evaluator
103
    test_Evaluator.cpp)
Z
zhangjinchao01 已提交
104 105 106 107 108 109 110 111 112 113

################ 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
114
        test_PyDataProvider.cpp)
Z
zhangjinchao01 已提交
115 116

    add_test(NAME test_PyDataProvider
117 118
        COMMAND .set_python_path.sh -d ./gserver/tests:${PADDLE_SOURCE_DIR}/python/ ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
119 120 121
endif()

############### test_RecurrentLayer #######################
122
add_simple_unittest(test_RecurrentLayer)
Z
zhangjinchao01 已提交
123

124 125
############### test_WarpCTCLayer #######################
if(NOT WITH_DOUBLE)
126
    add_unittest_without_exec(test_WarpCTCLayer
127
        test_WarpCTCLayer.cpp)
128 129

    add_test(NAME test_WarpCTCLayer
L
liaogang 已提交
130
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_WarpCTCLayer --warpctc_dir=${WARPCTC_LIB_DIR}
131
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
132 133
endif()

Z
zhangjinchao01 已提交
134 135 136 137 138 139 140
############### 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
141
            ${PADDLE_SOURCE_DIR}/python:${PADDLE_SOURCE_DIR}/paddle/gserver/tests
Z
zhangjinchao01 已提交
142
            ${CMAKE_CURRENT_BINARY_DIR}/test_RecurrentGradientMachine
143
    WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
144 145

add_unittest_without_exec(test_NetworkCompare
146
    test_NetworkCompare.cpp)
Z
zhangjinchao01 已提交
147 148
if(WITH_GPU)
    add_test(NAME test_NetworkCompare
149 150
        COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=true
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
151 152
else()
    add_test(NAME test_NetworkCompare
153 154
        COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_NetworkCompare --use_gpu=false
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle)
Z
zhangjinchao01 已提交
155 156 157 158 159 160 161
endif()


add_unittest_without_exec(test_PyDataProvider2
        test_PyDataProvider2.cpp)

add_test(NAME test_PyDataProvider2
162 163
   COMMAND .set_python_path.sh -d ${PADDLE_SOURCE_DIR}/paddle/gserver/tests:${PADDLE_SOURCE_DIR}/python ${CMAKE_CURRENT_BINARY_DIR}/test_PyDataProvider2
        WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}/paddle
Z
zhangjinchao01 已提交
164
)