39#include <wx/filename.h>
40#include <wx/stdpaths.h>
51 BOOST_CHECK_NE( pi.get(),
nullptr );
62 fn.AppendDir(
"eagle" );
63 fn.SetFullName( sch_file );
84 wxString tempDir = wxStandardPaths::Get().GetTempDir();
85 wxString projectPath = tempDir + wxFileName::GetPathSeparator() + wxT(
"eagle_test.kicad_pro" );
93 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( &
project );
103 loadedSheet = pi->LoadSchematicFile( eagleFn.GetFullPath(), schematic.get() );
105 catch(
const std::exception& e )
107 BOOST_FAIL( std::string(
"LoadSchematicFile threw: " ) + e.what() );
111 BOOST_FAIL(
"LoadSchematicFile threw unknown exception" );
119 const std::vector<SCH_SHEET*>& topSheets = schematic->GetTopLevelSheets();
127 BOOST_CHECK( sheet !=
nullptr );
128 BOOST_CHECK( sheet->m_Uuid !=
niluuid );
133 BOOST_CHECK( !sheet->GetScreen()->GetFileName().IsEmpty() );
139 SCH_SHEET_LIST hierarchy = schematic->BuildSheetListSortedByPageNumbers();
142 std::set<KIID_PATH> hierPaths;
145 hierPaths.insert(
path.Path() );
147 int totalSymbols = 0;
148 int orphanedSymbols = 0;
162 bool foundMatch =
false;
166 if( hierPaths.count( inst.m_Path ) )
178 BOOST_CHECK_GT( totalSymbols, 0 );
A base class for most all the KiCad significant classes used in schematics and boards.
EE_TYPE OfType(KICAD_T aType) const
void LoadProjectTables(std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={})
(Re)loads the project library tables in the given list, or all tables if no list is given
virtual SETTINGS_MANAGER & GetSettingsManager() const
virtual LIBRARY_MANAGER & GetLibraryManager() const
Container for project specific data.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
PGM_BASE & Pgm()
The global program "get" accessor.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
A simple container for schematic symbol instance information.
BOOST_AUTO_TEST_CASE(FindPlugin)
Checks that the SCH_IO manager finds the Eagle plugin.
static wxFileName getEagleTestSchematic(const wxString &sch_file)
Get a schematic file from the test data eagle subdir.
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_CHECK_EQUAL(result, "25.4")
Definition of file extensions used in Kicad.