21#include <boost/test/results_collector.hpp>
28#include <wx/filename.h>
29#include <wx/tokenzr.h>
39std::set<wxString> collectIncludeFileNames(
const wxString& aNetlist )
41 std::set<wxString> names;
42 wxStringTokenizer lines( aNetlist, wxS(
"\n" ), wxTOKEN_RET_EMPTY_ALL );
44 while( lines.HasMoreTokens() )
46 wxString line = lines.GetNextToken();
48 if( line.StartsWith( wxS(
".include " ) ) )
50 wxFileName fn( line.AfterFirst(
'"' ).BeforeLast(
'"' ) );
51 names.insert( fn.GetFullName() );
75 fn.SetName( aBaseName );
83 wxFileName netFile =
m_schematic->Project().GetProjectFullName();
86 netFile.SetName( netFile.GetName() +
"_test" );
88 netFile.SetExt(
"spice" );
89 return netFile.GetFullPath();
124 TestNetlist(
"issue13591" );
125 TestTranPoint( 100e-6, { {
"I(R1)", 0 }, {
"I(R2)", 0 } }, 0.00001 );
126 TestTranPoint( 500e-6, { {
"I(R1)", 0 }, {
"I(R2)", 0 } }, 0.00001 );
134 m_SaveCurrents =
false;
136 TestNetlist(
"issue13431" );
137 TestTranPoint( 0.005, { {
"V(/soft_start)", 2.489 } } );
138 TestTranPoint( 0.012, { {
"V(/soft_start)", 5.100 } } );
149 const MOCK_PGM_BASE&
program =
static_cast<MOCK_PGM_BASE&
>(
Pgm() );
152 TestNetlist(
"issue13112" );
153 TestTranPoint( 0.01, { {
"V(out)", -0.060 } } );
154 TestTranPoint( 0.02, { {
"V(out)", 0.856 } } );
166 TestNetlist(
"issue13162" );
167 TestTranPoint( 0.030, { {
"V(out)", 0.000829682 } } );
168 TestTranPoint( 0.035, { {
"V(out)", -0.000829692 } } );
179 TestNetlist(
"issue12505" );
180 TestTranPoint( 0.015, { {
"V(Net-_R1-Pad2_)", -311 } } );
181 TestTranPoint( 0.025, { {
"V(Net-_R1-Pad2_)", 311 } } );
192 TestNetlist(
"issue16223" );
193 TestTranPoint( 0.0, { {
"V(PRBS_OUTPUT)", 5.114 } } );
194 TestTranPoint( 1e-6, { {
"V(PRBS_OUTPUT)", -0.1144 } } );
208 wxFFile netlistFile( GetNetlistPath(
true ),
"rt" );
212 netlistFile.ReadAll( &
netlist );
217 std::set<wxString> includes = collectIncludeFileNames(
netlist );
221 for(
const wxString& ref : { wxS(
"U1" ), wxS(
"U2" ), wxS(
"U3" ),
222 wxS(
"U4" ), wxS(
"U5" ), wxS(
"U6" ) } )
224 wxString cacheName = ref + wxS(
".cache" );
227 "IBIS cache device " << cacheName <<
" was not emitted as a .include" );
244 model.SetParamValue(
"lib",
"device.lib" );
246 std::vector<wxString> includes =
model.GetSpiceIncludes( item,
nullptr,
249 BOOST_REQUIRE_EQUAL( includes.size(), 1u );
std::unique_ptr< SCHEMATIC > m_schematic
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
@ OPTION_SAVE_ALL_CURRENTS
@ OPTION_SAVE_ALL_VOLTAGES
@ OPTION_SAVE_ALL_DISSIPATIONS
@ OPTION_ADJUST_INCLUDE_PATHS
static REPORTER & GetInstance()
TEST_NETLIST_EXPORTER_SPICE_FIXTURE()
unsigned GetNetlistOptions() override
wxFileName SchematicQAPath(const wxString &aBaseName) override
TEST_SIM_REGRESSIONS_FIXTURE()
wxString GetNetlistPath(bool aTest=false) override
~TEST_SIM_REGRESSIONS_FIXTURE()
static const std::string KiCadSchematicFileExtension
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
PGM_BASE & Pgm()
The global program "get" accessor.
static void LoadSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName)
std::vector< FAB_LAYER_COLOR > dummy
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_TEST_INFO("Two-port Series .op current = "<< iDevice)
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_FIXTURE_TEST_CASE(WindowsPaths, TEST_SIM_REGRESSIONS_FIXTURE)
BOOST_AUTO_TEST_CASE(RawSpiceModelSuppliesLibraryInclude)
BOOST_CHECK_EQUAL(result, "25.4")