Browse Source

Add utest for CMake.

tags/v0.2.16.rc1
Zhang Xianyi 9 years ago
parent
commit
19a6dedfd6
2 changed files with 19 additions and 5 deletions
  1. +3
    -5
      CMakeLists.txt
  2. +16
    -0
      utest/CMakeLists.txt

+ 3
- 5
CMakeLists.txt View File

@@ -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)


+ 16
- 0
utest/CMakeLists.txt View File

@@ -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…
Cancel
Save