#    Copyright (C) 2016 University of the Basque Country, UPV/EHU.
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

cmake_minimum_required( VERSION 2.8 )
project( testsuite )

set( TESTSUITE_NAME testsuite )

set( TEST_SRC "src/test.c" )

link_directories( ${cuPoisson_BINARY_DIR}/${CMAKE_BUILD_TYPE} )

add_executable( ${TESTSUITE_NAME} ${TEST_SRC} )
target_link_libraries( ${TESTSUITE_NAME} cuPoisson )
target_link_libraries( ${TESTSUITE_NAME} ${CUDA_cufft_LIBRARY} )

add_test( num_devs       "${TESTSUITE_NAME}" "num_devs" )
add_test( lib_init_one   "${TESTSUITE_NAME}" "lib_init" "1" )
add_test( lib_init_all   "${TESTSUITE_NAME}" "lib_init" "-1" )
add_test( grid           "${TESTSUITE_NAME}" "grid" "10" "10" "10" "1.0" "1.0" "1.0" )
if( MOD_SERIAL )
	add_test( fft_solver_one "${TESTSUITE_NAME}" "fft_solver" "1" "${PROJECT_SOURCE_DIR}/data" "sinsum_8x8x8" )
	add_test( fft_solver_all "${TESTSUITE_NAME}" "fft_solver" "-1" "${PROJECT_SOURCE_DIR}/data" "sinsum_8x8x8" )
endif( MOD_SERIAL )
