You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.2 kB

1234567891011121314151617181920212223242526272829303132333435363738
  1. include_directories(${CMAKE_SOURCE_DIR})
  2. enable_language(Fortran)
  3. set(OpenBLAS_Tests
  4. sblat1 sblat2 sblat3
  5. dblat1 dblat2 dblat3
  6. cblat1 cblat2 cblat3
  7. zblat1 zblat2 zblat3)
  8. foreach(test_bin ${OpenBLAS_Tests})
  9. add_executable(${test_bin} ${test_bin}.f)
  10. target_link_libraries(${test_bin} ${OpenBLAS_LIBNAME}_static)
  11. endforeach()
  12. # $1 exec, $2 input, $3 output_result
  13. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh
  14. "rm -f $3\n"
  15. "$1 < $2\n"
  16. "grep -q FATAL $3\n"
  17. "if [ $? -eq 0 ]; then\n"
  18. "echo Error\n"
  19. "exit 1\n"
  20. "else\n"
  21. "exit 0\n"
  22. "fi\n"
  23. )
  24. set(float_types s d c z)
  25. foreach(float_type ${float_types})
  26. string(TOUPPER ${float_type} float_type_upper)
  27. add_test(NAME "${float_type}blas1"
  28. COMMAND "${CMAKE_CURRENT_BINARY_DIR}/${float_type}blat1")
  29. add_test(NAME "${float_type}blas2"
  30. COMMAND sh "${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh" "${CMAKE_CURRENT_BINARY_DIR}/${float_type}blat2" "${PROJECT_SOURCE_DIR}/test/${float_type}blat2.dat" ${float_type_upper}BLAT2.SUMM)
  31. add_test(NAME "${float_type}blas3"
  32. COMMAND sh "${CMAKE_CURRENT_BINARY_DIR}/test_helper.sh" "${CMAKE_CURRENT_BINARY_DIR}/${float_type}blat3" "${PROJECT_SOURCE_DIR}/test/${float_type}blat3.dat" ${float_type_upper}BLAT3.SUMM)
  33. endforeach()