diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d5aba5b..d226a7ade 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,10 +54,6 @@ if (NOT DYNAMIC_ARCH) list(APPEND BLASDIRS kernel) endif () -if (DEFINED UTEST_CHECK) - set(SANITY_CHECK 1) -endif () - if (DEFINED SANITY_CHECK) list(APPEND BLASDIRS reference) endif () @@ -140,6 +136,9 @@ add_library(${OpenBLAS_LIBNAME} SHARED ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET include("${CMAKE_SOURCE_DIR}/cmake/export.cmake") +enable_testing() +add_subdirectory(utest) + if(NOT MSVC) #only build shared library for MSVC add_library(${OpenBLAS_LIBNAME}_static STATIC ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET_OBJS}) @@ -152,7 +151,6 @@ target_link_libraries(${OpenBLAS_LIBNAME}_static pthread) endif() #build test and ctest -enable_testing() add_subdirectory(test) if(NOT NO_CBLAS) add_subdirectory(ctest) diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt new file mode 100644 index 000000000..f503b900d --- /dev/null +++ b/utest/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories(${CMAKE_SOURCE_DIR}) + +set(OpenBLAS_utest_src + utest_main.c + test_amax.c + ) + +set(OpenBLAS_utest_bin openblas_utest) +add_executable(${OpenBLAS_utest_bin} ${OpenBLAS_utest_src}) +target_link_libraries(${OpenBLAS_utest_bin} ${OpenBLAS_LIBNAME}) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +target_link_libraries(${OpenBLAS_utest_bin} m) +endif() + +add_test(${OpenBLAS_utest_bin} ${CMAKE_CURRENT_BINARY_DIR}/${OpenBLAS_utest_bin}) \ No newline at end of file