Give ngspice time to finish simulation in test suite.

This commit is contained in:
Jeff Young 2023-06-18 18:09:07 +01:00
parent e9046076a6
commit ee567180d1
1 changed files with 13 additions and 1 deletions

View File

@ -123,7 +123,19 @@ public:
ngspice->Command( "set ngbehavior=ps" );
ngspice->Command( "setseed 1" );
BOOST_REQUIRE( ngspice->LoadNetlist( std::string( netlist.ToUTF8() ) ) );
BOOST_REQUIRE( ngspice->Run() );
if( ngspice->Run() )
{
// wait for end of simulation.
// calling wxYield() allows printing activity, and stopping ngspice from GUI
// Also note: do not user wxSafeYield, because when using it we cannot stop
// ngspice from the GUI
do
{
wxMilliSleep( 50 );
wxYield();
} while( ngspice->IsRunning() );
}
// Test if ngspice cannot run a simulation (missing code models).
// in this case the log contains "MIF-ERROR" and/or "Error: circuit not parsed"