CMakeLists.txt 2.25 KB
Newer Older
1
# Utesting
berenger-bramas's avatar
berenger-bramas committed
2 3

# Find all code files
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
set(source_tests_files
  utestAlgorithmBuilder.cpp
  utestAlignedMemory.cpp
  utestBoolArray.cpp
  utestBuffer.cpp
  utestChebyshev.cpp
  utestChebyshevDirectPeriodic.cpp
  utestChebyshevDirectTsm.cpp
  utestChebyshevMpi.cpp
  utestChebyshevThread.cpp
  utestFBasicParticleContainer.cpp
  utestFBasicParticle.cpp
  utestFmmAlgorithmProc.cpp
  utestInterpolationMultiRhs.cpp
  utestLagrange.cpp
  utestLagrangeMpi.cpp
  utestLagrangeThread.cpp
  utestLetTree.cpp
  utestListBlockAllocator.cpp
  utestList.cpp
  utestMorton.cpp
  utestMpiBitonic.cpp
  utestMPILoader.cpp
  utestMpiQs.cpp
  utestMpiTreeBuilder.cpp
  utestNeighborIndexes.cpp
  utestOctree.cpp
  utestP2PExclusion.cpp
  utestQuicksort.cpp
  utestRotation.cpp
  utestRotationDirectSeveralTime.cpp
  utestRotationDirectTsm.cpp
  utestRotationThread.cpp
  utestSphericalBlasAlgorithm.cpp
  utestSpherical.cpp
  utestSphericalDirect.cpp
  utestSphericalWithPrevious.cpp
  utestStaticMpiTreeBuilder.cpp
  utestTest.cpp
  utestVector.cpp
  Utils/variadic_vector/utest_variadic_vector.cpp
  )
46

berenger-bramas's avatar
berenger-bramas committed
47
# Add execs - 1 cpp = 1 exec
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
foreach(exec ${source_tests_files}) 
  set(compile_exec TRUE)
  get_filename_component( execname ${exec} NAME_WE )
	
  foreach(fuse_key ${FUSE_DEP_AVAILABLE})
    file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
    if(lines_fuse AND NOT ${fuse_key} IN_LIST FUSE_LIST)
      message( STATUS "This needs ${fuse_key} = ${exec}" )
      set(compile_exec FALSE)
    endif()
  endforeach()

  # Dependency are OK
  if( compile_exec )
    add_executable( ${execname} ${exec})
    list(APPEND SCALFMM_TESTS_TARGETS ${execname})
    set_target_properties(${execname} PROPERTIES ENABLE_EXPORTS TRUE
      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE}
      )

    target_link_libraries( ${execname} PRIVATE ${CMAKE_PROJECT_NAME} )
    list(APPEND SCALFMM_UTESTS_TARGETS ${execname})

    if(lines_mpi)
      add_test(NAME ${execname} COMMAND $<IF:${MPIEXEC_EXECUTABLE}, ${MPIEXEC_EXECUTABLE} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${execname}>)
    else()
      add_test(NAME ${execname} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${execname})
COULAUD Olivier's avatar
COULAUD Olivier committed
75
    endif()
76
  endif()
berenger-bramas's avatar
berenger-bramas committed
77
endforeach(exec)
78 79 80

add_custom_target(scalfmm_utests ALL DEPENDS ${SCALFMM_UTESTS_TARGETS})