Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
54a2b1f6
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
54a2b1f6
编写于
12月 29, 2016
作者:
H
hedaoyuan
提交者:
GitHub
12月 29, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1003 from hedaoyuan/remove_main
Remove the main function inside the test file
上级
48b4c306
97f41534
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
12 addition
and
146 deletion
+12
-146
cmake/util.cmake
cmake/util.cmake
+3
-3
paddle/CMakeLists.txt
paddle/CMakeLists.txt
+1
-0
paddle/function/CMakeLists.txt
paddle/function/CMakeLists.txt
+2
-2
paddle/gserver/tests/test_LinearChainCRF.cpp
paddle/gserver/tests/test_LinearChainCRF.cpp
+0
-6
paddle/gserver/tests/test_ProtoDataProvider.cpp
paddle/gserver/tests/test_ProtoDataProvider.cpp
+0
-6
paddle/gserver/tests/test_WarpCTCLayer.cpp
paddle/gserver/tests/test_WarpCTCLayer.cpp
+0
-6
paddle/math/tests/test_Allocator.cpp
paddle/math/tests/test_Allocator.cpp
+0
-6
paddle/math/tests/test_BaseMatrix.cpp
paddle/math/tests/test_BaseMatrix.cpp
+0
-6
paddle/math/tests/test_CpuGpuVector.cpp
paddle/math/tests/test_CpuGpuVector.cpp
+0
-7
paddle/math/tests/test_ExecViaCpu.cpp
paddle/math/tests/test_ExecViaCpu.cpp
+0
-6
paddle/math/tests/test_Matrix.cpp
paddle/math/tests/test_Matrix.cpp
+0
-6
paddle/math/tests/test_SIMDFunctions.cpp
paddle/math/tests/test_SIMDFunctions.cpp
+0
-6
paddle/math/tests/test_SparseMatrix.cpp
paddle/math/tests/test_SparseMatrix.cpp
+0
-6
paddle/math/tests/test_Tensor.cu
paddle/math/tests/test_Tensor.cu
+0
-8
paddle/math/tests/test_TrainingAlgorithm.cpp
paddle/math/tests/test_TrainingAlgorithm.cpp
+0
-8
paddle/math/tests/test_batchTranspose.cpp
paddle/math/tests/test_batchTranspose.cpp
+0
-6
paddle/math/tests/test_lazyAssign.cu
paddle/math/tests/test_lazyAssign.cu
+0
-8
paddle/math/tests/test_matrixCompare.cpp
paddle/math/tests/test_matrixCompare.cpp
+0
-6
paddle/math/tests/test_sparseMatrixCompare.cpp
paddle/math/tests/test_sparseMatrixCompare.cpp
+0
-7
paddle/parameter/tests/test_common.cpp
paddle/parameter/tests/test_common.cpp
+0
-9
paddle/testing/CMakeLists.txt
paddle/testing/CMakeLists.txt
+6
-0
paddle/testing/TestMain.cpp
paddle/testing/TestMain.cpp
+0
-0
paddle/utils/tests/test_CustomStackTrace.cpp
paddle/utils/tests/test_CustomStackTrace.cpp
+0
-6
paddle/utils/tests/test_SIMDFlags.cpp
paddle/utils/tests/test_SIMDFlags.cpp
+0
-5
paddle/utils/tests/test_SpinLock.cpp
paddle/utils/tests/test_SpinLock.cpp
+0
-6
paddle/utils/tests/test_Thread.cpp
paddle/utils/tests/test_Thread.cpp
+0
-5
paddle/utils/tests/test_ThreadBarrier.cpp
paddle/utils/tests/test_ThreadBarrier.cpp
+0
-6
未找到文件。
cmake/util.cmake
浏览文件 @
54a2b1f6
...
...
@@ -107,7 +107,6 @@ function(link_paddle_exe TARGET_NAME)
paddle_parameter
paddle_proto
paddle_cuda
paddle_test_main
${
METRIC_LIBS
}
${
PROTOBUF_LIBRARY
}
${
LIBGLOG_LIBRARY
}
...
...
@@ -155,7 +154,8 @@ endfunction()
# Rest Arguemnts: not used.
function
(
link_paddle_test TARGET_NAME
)
link_paddle_exe
(
${
TARGET_NAME
}
)
target_link_libraries
(
${
TARGET_NAME
}
${
GTEST_MAIN_LIBRARIES
}
target_link_libraries
(
${
TARGET_NAME
}
paddle_test_main
${
GTEST_LIBRARIES
}
)
endfunction
()
...
...
paddle/CMakeLists.txt
浏览文件 @
54a2b1f6
add_subdirectory
(
cuda
)
add_subdirectory
(
function
)
add_subdirectory
(
utils
)
add_subdirectory
(
testing
)
add_subdirectory
(
math
)
add_subdirectory
(
parameter
)
add_subdirectory
(
gserver
)
...
...
paddle/function/CMakeLists.txt
浏览文件 @
54a2b1f6
...
...
@@ -11,14 +11,14 @@ endif()
add_library
(
paddle_function STATIC
${
cpp_files
}
${
cu_objs
}
)
add_library
(
paddle_test_main STATIC TestMain.cpp
)
if
(
WITH_GPU
)
if
(
WITH_TESTING
)
# TODO:
# file(GLOB test_files . *OpTest.cpp)
# add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files})
add_simple_unittest
(
CrossMapNormalOpTest
)
endif
()
endif
()
add_style_check_target
(
paddle_function
${
h_files
}
)
add_style_check_target
(
paddle_function
${
cpp_files
}
)
...
...
paddle/gserver/tests/test_LinearChainCRF.cpp
浏览文件 @
54a2b1f6
...
...
@@ -65,9 +65,3 @@ TEST(LinearChainCRF, decoding) {
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/gserver/tests/test_ProtoDataProvider.cpp
浏览文件 @
54a2b1f6
...
...
@@ -730,9 +730,3 @@ TEST(ProtoSequenceDataProvider, test) {
}
// end for (int numIdSlots : numSlotsArray)
}
// end for (int numSparseNonValueVecSlots : numSlotsArray)
}
int
main
(
int
argc
,
char
**
argv
)
{
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/gserver/tests/test_WarpCTCLayer.cpp
浏览文件 @
54a2b1f6
...
...
@@ -242,9 +242,3 @@ TEST(Layer, WarpCTCLayer) {
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_Allocator.cpp
浏览文件 @
54a2b1f6
...
...
@@ -120,9 +120,3 @@ TEST(MemoryHandle, Gpu) {
}
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_BaseMatrix.cpp
浏览文件 @
54a2b1f6
...
...
@@ -242,10 +242,4 @@ TEST(BaseMatrix, Other) {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
paddle
::
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
#endif
paddle/math/tests/test_CpuGpuVector.cpp
浏览文件 @
54a2b1f6
...
...
@@ -77,11 +77,4 @@ TEST(CpuGpuVector, subCreate) {
checkDataEqual
(
v1Check
->
getData
()
+
offset
,
v2Check
->
getData
(),
size2
);
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
int
ret
=
RUN_ALL_TESTS
();
return
ret
;
}
#endif
paddle/math/tests/test_ExecViaCpu.cpp
浏览文件 @
54a2b1f6
...
...
@@ -114,9 +114,3 @@ TEST(ExecViaCpu, test1) {
testWrapper
(
functor
);
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
paddle
::
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_Matrix.cpp
浏览文件 @
54a2b1f6
...
...
@@ -291,10 +291,4 @@ TEST(Matrix, multiBinaryCrossEntropy) {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
paddle
::
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
#endif
paddle/math/tests/test_SIMDFunctions.cpp
浏览文件 @
54a2b1f6
...
...
@@ -169,9 +169,3 @@ TEST(SIMDFunction, decayL1_WithoutLR) {
ASSERT_NEAR
(
dest
[
i
],
simd_dest
[
i
],
EPSILON
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
paddle
::
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_SparseMatrix.cpp
浏览文件 @
54a2b1f6
...
...
@@ -561,9 +561,3 @@ TEST(Matrix, SparseMatrixCSCFormatTrimFrom) {
checkSMatrixEqual2
(
matA
,
matD
);
#endif
}
int
main
(
int
argc
,
char
**
argv
)
{
paddle
::
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_Tensor.cu
浏览文件 @
54a2b1f6
...
...
@@ -1163,11 +1163,3 @@ TEST(Quaternary, CompareOp) {
TestQuaternaryMatrix
<
GpuMatrix
>
testGpu
(
testQuaternaryCompareOp
<
GpuMatrix
>
);
#endif
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
hl_start
();
hl_init
(
0
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_TrainingAlgorithm.cpp
浏览文件 @
54a2b1f6
...
...
@@ -459,11 +459,3 @@ void testSparseMomentum(size_t size, bool useGpu) {
}
TEST
(
Training
,
SparseMomentum
)
{
testCase
(
testSparseMomentum
);
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
hl_start
();
hl_init
(
FLAGS_gpu_id
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_batchTranspose.cpp
浏览文件 @
54a2b1f6
...
...
@@ -53,9 +53,3 @@ TEST(MatrixBatchTransTest, test_batch_matrix_transpose) {
checkMatrixEqual
(
cBatchTransMat
,
cMat_d2h
);
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
paddle
::
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_lazyAssign.cu
浏览文件 @
54a2b1f6
...
...
@@ -139,11 +139,3 @@ TEST(sgdUpdate, GPU) {
testMatrixCase
(
testSgdUpdate
<
GpuMatrix
>
);
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
hl_start
();
hl_init
(
0
);
return
RUN_ALL_TESTS
();
}
paddle/math/tests/test_matrixCompare.cpp
浏览文件 @
54a2b1f6
...
...
@@ -1262,10 +1262,4 @@ TEST(Matrix, MaxOutFwdBwd) {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
#endif
paddle/math/tests/test_sparseMatrixCompare.cpp
浏览文件 @
54a2b1f6
...
...
@@ -171,11 +171,4 @@ TEST(SMatrix, sMatrixCollectBias) {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
initMain
(
argc
,
argv
);
int
ret
=
RUN_ALL_TESTS
();
return
ret
;
}
#endif
paddle/parameter/tests/test_common.cpp
浏览文件 @
54a2b1f6
...
...
@@ -23,15 +23,6 @@ limitations under the License. */
using
namespace
paddle
;
// NOLINT
int
main
(
int
argc
,
char
**
argv
)
{
paddle
::
initMain
(
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
int
ret
=
RUN_ALL_TESTS
();
return
ret
;
}
class
CommonTest
:
public
::
testing
::
Test
{
protected:
CommonTest
()
:
testStat_
(
"test"
)
{}
...
...
paddle/testing/CMakeLists.txt
0 → 100644
浏览文件 @
54a2b1f6
# for paddle test case
if
(
WITH_TESTING
)
add_library
(
paddle_test_main STATIC TestMain.cpp
)
add_dependencies
(
paddle_test_main gen_proto_cpp
)
endif
()
paddle/
function
/TestMain.cpp
→
paddle/
testing
/TestMain.cpp
浏览文件 @
54a2b1f6
文件已移动
paddle/utils/tests/test_CustomStackTrace.cpp
浏览文件 @
54a2b1f6
...
...
@@ -96,9 +96,3 @@ TEST(CustomStackTrace, normalTest) {
}
});
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
paddle
::
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/utils/tests/test_SIMDFlags.cpp
浏览文件 @
54a2b1f6
...
...
@@ -44,8 +44,3 @@ TEST(SIMDFlags, normalPrint) {
LOG
(
INFO
)
<<
"Has AVX2: "
<<
std
::
boolalpha
<<
HAS_AVX2
;
LOG
(
INFO
)
<<
"Has AVX512: "
<<
std
::
boolalpha
<<
HAS_AVX512
;
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/utils/tests/test_SpinLock.cpp
浏览文件 @
54a2b1f6
...
...
@@ -53,9 +53,3 @@ TEST(ThreadSpinLock, normalTest) {
});
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
paddle
::
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/utils/tests/test_Thread.cpp
浏览文件 @
54a2b1f6
...
...
@@ -79,8 +79,3 @@ TEST(AsyncThreadPool, addBatchJobWithResults) {
ASSERT_EQ
(
res
[
i
],
i
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
paddle/utils/tests/test_ThreadBarrier.cpp
浏览文件 @
54a2b1f6
...
...
@@ -64,9 +64,3 @@ TEST(ThreadBarrier, normalTest) {
});
}
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
paddle
::
initMain
(
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录