From 918c1ed1c0674610920b4ce1ba32e5c1c17182a7 Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Wed, 28 Dec 2016 19:20:09 +0800 Subject: [PATCH] move TestMain.cpp to testing --- paddle/CMakeLists.txt | 1 + paddle/function/CMakeLists.txt | 2 ++ paddle/testing/CMakeLists.txt | 6 ++++++ paddle/{utils => testing}/TestMain.cpp | 0 paddle/utils/CMakeLists.txt | 2 -- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 paddle/testing/CMakeLists.txt rename paddle/{utils => testing}/TestMain.cpp (100%) diff --git a/paddle/CMakeLists.txt b/paddle/CMakeLists.txt index 2daea052b0..503024cff3 100644 --- a/paddle/CMakeLists.txt +++ b/paddle/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(cuda) add_subdirectory(function) add_subdirectory(utils) +add_subdirectory(testing) add_subdirectory(math) add_subdirectory(parameter) add_subdirectory(gserver) diff --git a/paddle/function/CMakeLists.txt b/paddle/function/CMakeLists.txt index c997448749..39bfa169d4 100644 --- a/paddle/function/CMakeLists.txt +++ b/paddle/function/CMakeLists.txt @@ -12,11 +12,13 @@ endif() add_library(paddle_function STATIC ${cpp_files} ${cu_objs}) if(WITH_GPU) +if(WITH_TESTING) # TODO: # file(GLOB test_files . *_op_test.cpp) # add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files}) add_simple_unittest(cross_map_normal_op_test) endif() +endif() add_style_check_target(paddle_function ${h_files}) add_style_check_target(paddle_function ${cpp_files}) diff --git a/paddle/testing/CMakeLists.txt b/paddle/testing/CMakeLists.txt new file mode 100644 index 0000000000..584498c860 --- /dev/null +++ b/paddle/testing/CMakeLists.txt @@ -0,0 +1,6 @@ +# for paddle test case + +if(WITH_TESTING) + add_library(paddle_test_main STATIC TestMain.cpp) + add_dependencies(paddle_test_main gen_proto_cpp) +endif() diff --git a/paddle/utils/TestMain.cpp b/paddle/testing/TestMain.cpp similarity index 100% rename from paddle/utils/TestMain.cpp rename to paddle/testing/TestMain.cpp diff --git a/paddle/utils/CMakeLists.txt b/paddle/utils/CMakeLists.txt index cf5a833014..45240b5002 100644 --- a/paddle/utils/CMakeLists.txt +++ b/paddle/utils/CMakeLists.txt @@ -5,8 +5,6 @@ file(GLOB UTIL_SOURCES . *.cpp) create_resources(enable_virtualenv.py enable_virtualenv.c) set(UTIL_RES enable_virtualenv.c) -add_library(paddle_test_main STATIC TestMain.cpp) - if(APPLE) file(GLOB UTIL_ARCH_SOURCES . arch/osx/*.cpp) else() -- GitLab