From 6cd4c2c967ff1898cdf61ff587bb7420c48f0a71 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 4 Aug 2019 14:52:50 +0800 Subject: [PATCH] cmake: move tests to where they are implemented Signed-off-by: Kefu Chai --- src/pybind/mgr/CMakeLists.txt | 3 +++ src/pybind/mgr/ansible/CMakeLists.txt | 4 ++++ src/pybind/mgr/dashboard/CMakeLists.txt | 5 +++++ src/pybind/mgr/insights/CMakeLists.txt | 4 ++++ src/pybind/mgr/orchestrator_cli/CMakeLists.txt | 4 ++++ src/python-common/CMakeLists.txt | 5 +++++ src/test/CMakeLists.txt | 18 ------------------ src/tools/cephfs/CMakeLists.txt | 4 ++++ 8 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 src/pybind/mgr/ansible/CMakeLists.txt create mode 100644 src/pybind/mgr/insights/CMakeLists.txt create mode 100644 src/pybind/mgr/orchestrator_cli/CMakeLists.txt diff --git a/src/pybind/mgr/CMakeLists.txt b/src/pybind/mgr/CMakeLists.txt index e7a373e0c8262..2b5f4a7d4ad73 100644 --- a/src/pybind/mgr/CMakeLists.txt +++ b/src/pybind/mgr/CMakeLists.txt @@ -1,4 +1,7 @@ add_subdirectory(dashboard) +add_subdirectory(insights) +add_subdirectory(ansible) +add_subdirectory(orchestrator_cli) # Location needs to match default setting for mgr_module_path, currently: # OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr") diff --git a/src/pybind/mgr/ansible/CMakeLists.txt b/src/pybind/mgr/ansible/CMakeLists.txt new file mode 100644 index 0000000000000..4ef18461942d1 --- /dev/null +++ b/src/pybind/mgr/ansible/CMakeLists.txt @@ -0,0 +1,4 @@ +if(WITH_TESTS) + include(AddCephTest) + add_tox_test(mgr-ansible ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/pybind/mgr/dashboard/CMakeLists.txt b/src/pybind/mgr/dashboard/CMakeLists.txt index 29ee2c8da6bd4..29ea53db0920d 100644 --- a/src/pybind/mgr/dashboard/CMakeLists.txt +++ b/src/pybind/mgr/dashboard/CMakeLists.txt @@ -95,3 +95,8 @@ add_custom_target(mgr-dashboard-frontend-build WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend) add_dependencies(tests mgr-dashboard-frontend-build) endif(WITH_MGR_DASHBOARD_FRONTEND AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64|arm|ARM") + +if(WITH_TESTS) + include(AddCephTest) + add_tox_test(mgr-dashboard ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/pybind/mgr/insights/CMakeLists.txt b/src/pybind/mgr/insights/CMakeLists.txt new file mode 100644 index 0000000000000..6137c32b704c1 --- /dev/null +++ b/src/pybind/mgr/insights/CMakeLists.txt @@ -0,0 +1,4 @@ +if(WITH_TESTS) + include(AddCephTest) + add_tox_test(mgr-insights ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/pybind/mgr/orchestrator_cli/CMakeLists.txt b/src/pybind/mgr/orchestrator_cli/CMakeLists.txt new file mode 100644 index 0000000000000..f2e2fefc28de9 --- /dev/null +++ b/src/pybind/mgr/orchestrator_cli/CMakeLists.txt @@ -0,0 +1,4 @@ +if(WITH_TESTS) + include(AddCephTest) + add_tox_test(mgr-orchestrator_cli ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/python-common/CMakeLists.txt b/src/python-common/CMakeLists.txt index 90d9eb4bad5f0..08729d520a2ef 100644 --- a/src/python-common/CMakeLists.txt +++ b/src/python-common/CMakeLists.txt @@ -10,3 +10,8 @@ foreach(python_version ${py_vers}) distutils_install_module(ceph PYTHON_VERSION ${python_version}) endforeach() + +if(WITH_TESTS) + include(AddCephTest) + add_tox_test(python-common ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index d9649f86fd80a..08e8166325b95 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -540,24 +540,6 @@ add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_obje add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) -if(WITH_MGR) - add_tox_test(mgr-dashboard - ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard) - add_tox_test(mgr-insights - ${CMAKE_SOURCE_DIR}/src/pybind/mgr/insights) - add_tox_test(mgr-ansible - ${CMAKE_SOURCE_DIR}/src/pybind/mgr/ansible) - add_tox_test(mgr-orchestrator_cli - ${CMAKE_SOURCE_DIR}/src/pybind/mgr/orchestrator_cli) - add_tox_test(python-common - ${CMAKE_SOURCE_DIR}/src/python-common) -endif() - -if(WITH_CEPHFS_SHELL) - add_tox_test(cephfs-shell - ${CMAKE_SOURCE_DIR}/src/tools/cephfs) -endif() - set_property( TEST ${tox_tests} PROPERTY ENVIRONMENT ${env_vars_for_tox_tests}) diff --git a/src/tools/cephfs/CMakeLists.txt b/src/tools/cephfs/CMakeLists.txt index de23878b18148..41da8e3a7ac40 100644 --- a/src/tools/cephfs/CMakeLists.txt +++ b/src/tools/cephfs/CMakeLists.txt @@ -47,4 +47,8 @@ if(WITH_CEPHFS_SHELL) distutils_install_module(cephfs-shell PYTHON_VERSION 3) endif() + if(WITH_TESTS) + include(AddCephTest) + add_tox_test(cephfs-shell ${CMAKE_CURRENT_SOURCE_DIR}) + endif() endif() -- 2.39.5