42 m_schematic( nullptr ),
58 wxFileName fn = GetSchematicPath( aBaseName );
60 BOOST_TEST_MESSAGE( fn.GetFullPath() );
67 m_manager.LoadProject( pro.GetFullPath() );
71 m_schematic.SetProject( &m_manager.Prj() );
72 m_schematic.SetRoot( m_pi->LoadSchematicFile( fn.GetFullPath(), &m_schematic ) );
74 BOOST_REQUIRE_EQUAL( m_pi->GetError().IsEmpty(),
true );
76 m_schematic.CurrentSheet().push_back( &m_schematic.Root() );
80 for(
SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
81 screen->UpdateLocalLibSymbolLinks();
83 SCH_SHEET_LIST sheets = m_schematic.BuildSheetListSortedByPageNumbers();
86 if( m_schematic.RootScreen()->GetFileFormatVersionAtLoad() < 20221002 )
89 if( m_schematic.RootScreen()->GetFileFormatVersionAtLoad() < 20221110 )
92 if( m_schematic.RootScreen()->GetFileFormatVersionAtLoad() < 20221206 )
94 for(
SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
95 screen->MigrateSimModels();
98 if( m_schematic.RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
99 screens.FixLegacyPowerSymbolMismatches();
105 sheet.UpdateAllScreenReferences();
110 std::unordered_set<SCH_SCREEN*> all_screens;
113 all_screens.insert(
path.LastScreen() );
117 m_schematic.ConnectionGraph()->Recalculate( sheets,
true );
124 fn.AppendDir(
"netlists" );
125 fn.AppendDir( aBaseName );
126 fn.SetName( aBaseName );
133template <
typename Exporter>
136 wxFileName netFile = m_schematic.Prj().GetProjectFullName();
139 netFile.SetName( netFile.GetName() +
"_test" );
143 return netFile.GetFullPath();
147template <
typename Exporter>
151 if( wxFileExists( GetNetlistPath(
true ) ) )
152 wxRemoveFile( GetNetlistPath(
true ) );
155 std::unique_ptr<Exporter> exporter = std::make_unique<Exporter>( &m_schematic );
157 bool success = exporter->WriteNetlist( GetNetlistPath(
true ), GetNetlistOptions(), reporter );
159 BOOST_REQUIRE( success && reporter.
GetMessages().IsEmpty() );
163template <
typename Exporter>
166 wxRemoveFile( GetNetlistPath(
true ) );
171template <
typename Exporter>
~SCHEMATIC_TEST_FIXTURE()
virtual void LoadSchematic(const wxString &aRelativePath)
virtual wxFileName GetSchematicPath(const wxString &aBaseName)
A factory which returns an instance of a SCH_IO.
static std::vector< std::pair< SCH_RULE_AREA *, SCH_SCREEN * > > UpdateRuleAreasInScreens(std::unordered_set< SCH_SCREEN * > &screens, KIGFX::SCH_VIEW *view)
Updates all rule area connectvity / caches in the given sheet paths.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void UpdateSheetInstanceData(const std::vector< SCH_SHEET_INSTANCE > &aSheetInstances)
Update all of the sheet instance information using aSheetInstances.
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
void UpdateSymbolInstanceData(const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void TestNetlist(const wxString &aBaseName)
virtual wxString GetNetlistPath(bool aTest=false)
A wrapper for reporting to a wxString object.
const wxString & GetMessages() const
static const std::string NetlistFileExtension
static const std::string ProjectFileExtension
static const std::string KiCadSchematicFileExtension
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of file extensions used in Kicad.