/*
 *  ticket-681.sli
 *
 *  This file is part of NEST.
 *
 *  Copyright (C) 2004 The NEST Initiative
 *
 *  NEST is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  NEST is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with NEST.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/* BeginDocumentation

Name: testsuite::ticket-681 - Ensure that NEST handles errors during node preparation properly

Synopsis: (ticket-681) run -> NEST exits if test fails

Description: 
Ensures that NEST handles errors during calibration gracefully.

This test will be run only if NEST is compiled without MPI but with Threads.
 
Author: Hans E Plesser, 2014-11-25, based on reproducer for #536.
 */

(unittest) run
/unittest using

skip_if_not_threaded

% preparatory work for proper test code in case NEST is complied with MPI support
% For now we just ignore this test, this will later be replaced 
% by a restart of NEST with a serial binary.
skip_if_have_mpi

M_ERROR setverbosity

{
    ResetKernel
    0 << /local_num_threads 4 /overwrite_files false >> SetStatus
    /iaf_neuron 4 << /I_e 1500.0 >> Create ;
    /spike_detector << /to_file true >> Create ;
    [1 2 3 4] [5] Connect
    1000 Simulate
	
    ResetKernel
    0  << /local_num_threads 4 /overwrite_files false >> SetStatus
    /iaf_neuron 4 << /I_e 1500.0 >> Create ;
    /spike_detector << /to_file true >> Create ;
    [1 2 3 4] [5] Connect
    1000 Simulate
} failbutnocrash_or_die
