function(PerformanceTest NAME SPEED DEPS)
    set(TEST "PTest${NAME}")
    add_executable(${TEST} ${NAME}.cpp ${DEPS})
    target_link_libraries(${TEST} ${BornAgainGUI_LIBRARY})
    if((${SPEED} STREQUAL "fast") OR SLOWTESTS)
        add_test(GUI.Performance.${NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST})
    endif()
endfunction()

PerformanceTest(CsvImportAssistantPerformanceTest "fast" "")
PerformanceTest(GUIPerformanceTest "too_slow" ../Benchmark.cpp) # don't run (timeout after 1500s)
