Add utest for CMake.
This commit is contained in:
parent
0e2b92e216
commit
19a6dedfd6
|
@ -54,10 +54,6 @@ if (NOT DYNAMIC_ARCH)
|
||||||
list(APPEND BLASDIRS kernel)
|
list(APPEND BLASDIRS kernel)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (DEFINED UTEST_CHECK)
|
|
||||||
set(SANITY_CHECK 1)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (DEFINED SANITY_CHECK)
|
if (DEFINED SANITY_CHECK)
|
||||||
list(APPEND BLASDIRS reference)
|
list(APPEND BLASDIRS reference)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -140,6 +136,9 @@ add_library(${OpenBLAS_LIBNAME} SHARED ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET
|
||||||
include("${CMAKE_SOURCE_DIR}/cmake/export.cmake")
|
include("${CMAKE_SOURCE_DIR}/cmake/export.cmake")
|
||||||
|
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory(utest)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
#only build shared library for MSVC
|
#only build shared library for MSVC
|
||||||
add_library(${OpenBLAS_LIBNAME}_static STATIC ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET_OBJS})
|
add_library(${OpenBLAS_LIBNAME}_static STATIC ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET_OBJS})
|
||||||
|
@ -152,7 +151,6 @@ target_link_libraries(${OpenBLAS_LIBNAME}_static pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#build test and ctest
|
#build test and ctest
|
||||||
enable_testing()
|
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
if(NOT NO_CBLAS)
|
if(NOT NO_CBLAS)
|
||||||
add_subdirectory(ctest)
|
add_subdirectory(ctest)
|
||||||
|
|
|
@ -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})
|
Loading…
Reference in New Issue