From 6b756e8c6324e9c72f8a1033f34318d2396b2215 Mon Sep 17 00:00:00 2001 From: zhangbo9674 <82555433+zhangbo9674@users.noreply.github.com> Date: Fri, 14 Apr 2023 10:49:40 +0800 Subject: [PATCH] [IR] Move paddle_ir_test to test_ir (#52877) * move paddle_ir_test to test_ir * fix bug * fix bug --- paddle/ir/CMakeLists.txt | 3 --- paddle/ir/tests/CMakeLists.txt | 3 --- test/cpp/CMakeLists.txt | 1 + test/cpp/ir/CMakeLists.txt | 5 +++++ {paddle/ir/tests => test/cpp/ir}/ir_attribute_test.cc | 0 {paddle/ir/tests => test/cpp/ir}/ir_value_test.cc | 0 {paddle/ir/tests => test/cpp/ir}/type_test.cc | 0 7 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 paddle/ir/tests/CMakeLists.txt create mode 100644 test/cpp/ir/CMakeLists.txt rename {paddle/ir/tests => test/cpp/ir}/ir_attribute_test.cc (100%) rename {paddle/ir/tests => test/cpp/ir}/ir_value_test.cc (100%) rename {paddle/ir/tests => test/cpp/ir}/type_test.cc (100%) diff --git a/paddle/ir/CMakeLists.txt b/paddle/ir/CMakeLists.txt index 5e6af70335a..084ee7e52ca 100644 --- a/paddle/ir/CMakeLists.txt +++ b/paddle/ir/CMakeLists.txt @@ -5,9 +5,6 @@ endif() set(NEWIR_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/ir") set(NEWIR_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/ir") -# ir tests -add_subdirectory(tests) - file(GLOB IR_SRCS "*.cc") cc_library(new_ir SRCS ${IR_SRCS}) diff --git a/paddle/ir/tests/CMakeLists.txt b/paddle/ir/tests/CMakeLists.txt deleted file mode 100644 index e012ec5bd26..00000000000 --- a/paddle/ir/tests/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -cc_test_old(type_test SRCS type_test.cc DEPS new_ir gtest) -cc_test_old(ir_attribute_test SRCS ir_attribute_test.cc DEPS new_ir gtest) -cc_test_old(ir_value_test SRCS ir_value_test.cc DEPS new_ir gtest) diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt index 752fa86168a..3b896f38c5c 100644 --- a/test/cpp/CMakeLists.txt +++ b/test/cpp/CMakeLists.txt @@ -3,3 +3,4 @@ add_subdirectory(jit) add_subdirectory(new_executor) add_subdirectory(prim) add_subdirectory(imperative) +add_subdirectory(ir) diff --git a/test/cpp/ir/CMakeLists.txt b/test/cpp/ir/CMakeLists.txt new file mode 100644 index 00000000000..48feb56c2e2 --- /dev/null +++ b/test/cpp/ir/CMakeLists.txt @@ -0,0 +1,5 @@ +if(WITH_NEWIR) + cc_test_old(type_test SRCS type_test.cc DEPS new_ir gtest) + cc_test_old(ir_attribute_test SRCS ir_attribute_test.cc DEPS new_ir gtest) + cc_test_old(ir_value_test SRCS ir_value_test.cc DEPS new_ir gtest) +endif() diff --git a/paddle/ir/tests/ir_attribute_test.cc b/test/cpp/ir/ir_attribute_test.cc similarity index 100% rename from paddle/ir/tests/ir_attribute_test.cc rename to test/cpp/ir/ir_attribute_test.cc diff --git a/paddle/ir/tests/ir_value_test.cc b/test/cpp/ir/ir_value_test.cc similarity index 100% rename from paddle/ir/tests/ir_value_test.cc rename to test/cpp/ir/ir_value_test.cc diff --git a/paddle/ir/tests/type_test.cc b/test/cpp/ir/type_test.cc similarity index 100% rename from paddle/ir/tests/type_test.cc rename to test/cpp/ir/type_test.cc -- GitLab