diff --git a/CMakeLists.txt b/CMakeLists.txt index 644d703db4..e5de98d609 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -enable_testing() +include(CTest) find_package(Threads REQUIRED) find_package(ROCM 0.7.3 REQUIRED PATHS /opt/rocm) @@ -782,8 +782,12 @@ add_subdirectory(src) if(MIOPEN_BUILD_DRIVER) add_subdirectory(driver) endif() -add_subdirectory(test) -add_subdirectory(speedtests) + +if(BUILD_TESTING) + add_subdirectory(test) + add_subdirectory(speedtests) +endif() + add_subdirectory(utils) if(MIOPEN_ENABLE_FIN) add_subdirectory(fin) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 66666d9c41..d89a8bdffb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,7 +50,6 @@ endif() configure_file("${MODEL_FILE}" "${PROJECT_BINARY_DIR}/share/miopen/perf_models/${MODEL_FILE_FILENAME}" COPYONLY) endforeach() -include(CTest) include(CheckCXXCompilerFlag) option( MIOPEN_TEST_ALL "Run the full test suite" OFF ) diff --git a/test/gtest/CMakeLists.txt b/test/gtest/CMakeLists.txt index 2740730a90..b850eb54ed 100644 --- a/test/gtest/CMakeLists.txt +++ b/test/gtest/CMakeLists.txt @@ -1,5 +1,4 @@ include(gtest) #include gtest.cmake -enable_testing() find_package(rocblas)