EXECUTE_PROCESS( 
    COMMAND ${CMAKE_CTEST_COMMAND} -R ${TEST} 
    RESULT_VARIABLE RESULT) 
IF(NOT RESULT EQUAL 0) 
    FILE(REMOVE ${TARGET}) 
    MESSAGE(FATAL_ERROR "Test ${TEST} [${TARGET}] failed.") 
ENDIF() 
