function(tdm_serving_add_test UTEST_SOURCE_FILES)
  foreach(file ${UTEST_SOURCE_FILES})
    string(REGEX REPLACE ".*/" "" file_exe0 ${file})
    string(REGEX REPLACE "\\..*" "" file_exe ${file_exe0})
    add_executable(${file_exe} ${file})
    target_link_libraries(${file_exe} ${ARGN} gcov)
    add_test(${file_exe} ${file_exe} COMMAND ${file_exe})
  endforeach()
endfunction()

function(tdm_serving_add_executable BENCH_SOURCE_FILES)
  foreach(file ${BENCH_SOURCE_FILES})
    string(REGEX REPLACE ".*/" "" file_exe0 ${file})
    string(REGEX REPLACE "\\..*" "" file_exe ${file_exe0})
    add_executable(${file_exe} ${file})
    target_link_libraries(${file_exe} ${ARGN})
  endforeach()
endfunction()
