#if(testing_included)
    #return()
#endif(testing_included)
#set(testing_included true)
enable_testing()

function(add_unit_test module test_name)
    message("-- Building test ${test_name} for ${module}")
    set(name "${module}_test")
    if(NOT TARGET ${name})
        # TODO : voir pq il trouve pas les bonnes sources
        file(GLOB TEST_SRC . test*.cpp)
        message("-- Building test executable : ${name} for module : ${module}")
        message("-- sources : ${TEST_SRC}")
        add_executable(${name} ${TEST_SRC})
        target_link_libraries(${name} ${module})
        set(test_not_created false)
    endif(NOT TARGET ${name})
    add_test(${test_name} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/${name}")
endfunction()
