fix return code for ctest (fix #703)