29#include <boost/test/unit_test.hpp>
42#include <wx/filename.h>
44#include <wx/stdpaths.h>
57 wxString tempDir = wxStandardPaths::Get().GetTempDir();
58 wxString projectPath = tempDir + wxFileName::GetPathSeparator() + wxT(
"test_legacy.kicad_pro");
60 settingsManager.
LoadProject( projectPath.ToStdString() );
61 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>(
nullptr );
63 schematic->SetProject(
project );
67 fn.AppendDir(
"legacy_hierarchy" );
68 fn.SetName(
"legacy_hierarchy" );
70 wxString mainFile = fn.GetFullPath();
78 BOOST_CHECK_NO_THROW( loadedSheet = io.
LoadSchematicFile( mainFile, schematic.get() ) );
82 schematic->SetRoot( loadedSheet );
85 schematic->RefreshHierarchy();
94 if( hierarchy.size() >= 2 )
106 wxString ref = symbol->
GetRef( &subSheetPath,
false );
109 <<
" ref: " << ref.ToStdString() );
EE_TYPE OfType(KICAD_T aType) const
wxString AsString() const
wxString AsString() const
Container for project specific data.
A SCH_IO derivation for loading schematic files using the new s-expression file format.
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void CheckForMissingSymbolInstances(const wxString &aProjectName)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
SCH_SCREEN * LastScreen()
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
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.
static const std::string KiCadSchematicFileExtension
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
wxLogTrace helper definitions.