QA eeschema tests: avoid crash if spice code models are not found.

This commit is contained in:
jean-pierre charras 2022-08-12 10:49:57 +02:00
parent bbc0c61ccb
commit 9b20e7debb
1 changed files with 8 additions and 0 deletions

View File

@ -120,6 +120,14 @@ public:
BOOST_REQUIRE( ngspice->LoadNetlist( netlist.ToStdString() ) ); BOOST_REQUIRE( ngspice->LoadNetlist( netlist.ToStdString() ) );
BOOST_REQUIRE( ngspice->Run() ); BOOST_REQUIRE( ngspice->Run() );
// Test if ngspice cannot run a simulation (missing code models).
// in this case the log contains "MIF-ERROR" and/or "Error: circuit not parsed"
// when the simulation is not run the spice command "linearize" crashes.
bool err_found = m_log->Find( wxT( "Error: circuit not parsed" ) ) != wxNOT_FOUND;
if( err_found )
return;
// We need to make sure that the number of points always the same. // We need to make sure that the number of points always the same.
ngspice->Command( "linearize" ); ngspice->Command( "linearize" );