From aff63425261a4bf4c8983b8457b0bf541581799e Mon Sep 17 00:00:00 2001 From: xiaoyewww <641311428@qq.com> Date: Sun, 21 Jan 2024 13:47:12 +0000 Subject: [PATCH] feat(ctest): move ut to test --- paddle/utils/CMakeLists.txt | 20 ----------------- test/cpp/CMakeLists.txt | 1 + test/cpp/utils/CMakeLists.txt | 22 +++++++++++++++++++ {paddle => test/cpp}/utils/array_ref_test.cc | 0 .../cpp}/utils/flags_native_test.cc | 0 .../cpp}/utils/small_vector_test.cc | 0 {paddle => test/cpp}/utils/span_test.cc | 0 {paddle => test/cpp}/utils/variant_test.cc | 0 8 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 test/cpp/utils/CMakeLists.txt rename {paddle => test/cpp}/utils/array_ref_test.cc (100%) rename {paddle => test/cpp}/utils/flags_native_test.cc (100%) rename {paddle => test/cpp}/utils/small_vector_test.cc (100%) rename {paddle => test/cpp}/utils/span_test.cc (100%) rename {paddle => test/cpp}/utils/variant_test.cc (100%) diff --git a/paddle/utils/CMakeLists.txt b/paddle/utils/CMakeLists.txt index ada3bb2fda76e9..fa5044f547e282 100644 --- a/paddle/utils/CMakeLists.txt +++ b/paddle/utils/CMakeLists.txt @@ -3,30 +3,10 @@ if(NOT WITH_GFLAGS) if(CINN_ONLY) return() endif() - paddle_test(flags_native_test SRCS flags_native_test.cc DEPS paddle_flags) endif() add_subdirectory(string) -paddle_test( - array_ref_test - SRCS - array_ref_test.cc - DEPS - gtest - phi - common) -paddle_test( - small_vector_test - SRCS - small_vector_test.cc - DEPS - gtest - phi - common) -paddle_test(variant_test SRCS variant_test.cc DEPS gtest) -paddle_test(span_test SRCS span_test.cc DEPS gtest) - if(NOT ((NOT WITH_PYTHON) AND ON_INFER)) cc_library( pybind_util diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt index 879449512c57d7..5256aec68452d9 100644 --- a/test/cpp/CMakeLists.txt +++ b/test/cpp/CMakeLists.txt @@ -8,3 +8,4 @@ add_subdirectory(pir) add_subdirectory(inference) add_subdirectory(eager) add_subdirectory(fluid) +add_subdirectory(utils) diff --git a/test/cpp/utils/CMakeLists.txt b/test/cpp/utils/CMakeLists.txt new file mode 100644 index 00000000000000..72cd17b3a11a33 --- /dev/null +++ b/test/cpp/utils/CMakeLists.txt @@ -0,0 +1,22 @@ +if(NOT WITH_GFLAGS) + paddle_test(flags_native_test SRCS flags_native_test.cc DEPS paddle_flags) +endif() + +paddle_test( + array_ref_test + SRCS + array_ref_test.cc + DEPS + gtest + phi + common) +paddle_test( + small_vector_test + SRCS + small_vector_test.cc + DEPS + gtest + phi + common) +paddle_test(variant_test SRCS variant_test.cc DEPS gtest) +paddle_test(span_test SRCS span_test.cc DEPS gtest) diff --git a/paddle/utils/array_ref_test.cc b/test/cpp/utils/array_ref_test.cc similarity index 100% rename from paddle/utils/array_ref_test.cc rename to test/cpp/utils/array_ref_test.cc diff --git a/paddle/utils/flags_native_test.cc b/test/cpp/utils/flags_native_test.cc similarity index 100% rename from paddle/utils/flags_native_test.cc rename to test/cpp/utils/flags_native_test.cc diff --git a/paddle/utils/small_vector_test.cc b/test/cpp/utils/small_vector_test.cc similarity index 100% rename from paddle/utils/small_vector_test.cc rename to test/cpp/utils/small_vector_test.cc diff --git a/paddle/utils/span_test.cc b/test/cpp/utils/span_test.cc similarity index 100% rename from paddle/utils/span_test.cc rename to test/cpp/utils/span_test.cc diff --git a/paddle/utils/variant_test.cc b/test/cpp/utils/variant_test.cc similarity index 100% rename from paddle/utils/variant_test.cc rename to test/cpp/utils/variant_test.cc