30#include <boost/test/unit_test.hpp>
42#include <wx/filename.h>
43#include <wx/stdpaths.h>
44#include <wx/textfile.h>
52 wxString tempDir = wxStandardPaths::Get().GetTempDir();
53 wxString projectPath = tempDir + wxFileName::GetPathSeparator() + wxT(
"test_project.kicad_pro" );
57 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
66 if( wxFileExists( file ) )
75 wxString tempDir = wxStandardPaths::Get().GetTempDir();
76 wxString fileName = wxFileName::CreateTempFileName( tempDir + wxFileName::GetPathSeparator() + aPrefix );
77 fileName += wxT(
".kicad_sch" );
100 m_schematic->CreateDefaultScreens();
102 std::vector<SCH_SHEET*> topSheets = m_schematic->GetTopLevelSheets();
105 SCH_SCREEN* screen = topSheets[0]->GetScreen();
118 m_schematic->RefreshHierarchy();
131 wxString fileName = GetTempSchFile( wxT(
"test_projname" ) );
144 bool foundProjectClause =
false;
145 bool foundEmptyProject =
false;
147 for(
size_t i = 0; i < textFile.GetLineCount(); i++ )
149 wxString line = textFile.GetLine( i );
151 if( line.Contains( wxT(
"(project \"test_project\"" ) ) )
152 foundProjectClause =
true;
154 if( line.Contains( wxT(
"(project \"\"" ) ) )
155 foundEmptyProject =
true;
160 BOOST_CHECK_MESSAGE( foundProjectClause,
"Saved file must contain (project \"test_project\")" );
161 BOOST_CHECK_MESSAGE( !foundEmptyProject,
"Saved file must NOT contain (project \"\")" );
A logical library item identifier and consists of various portions much like a URI.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Container for project specific data.
void SetText(const wxString &aText) override
A SCH_IO derivation for loading schematic files using the new s-expression file format.
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aSchematic to a storage file in a format that this SCH_IO implementation knows about,...
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
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...
void SetLibId(const LIB_ID &aName)
void SetPosition(const VECTOR2I &aPosition) override
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
bool GetInstance(SCH_SYMBOL_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
void SetPrefix(const wxString &aPrefix)
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
std::vector< FAB_LAYER_COLOR > dummy
std::vector< wxString > m_tempFiles
wxString GetTempSchFile(const wxString &aPrefix)
std::unique_ptr< SCHEMATIC > m_schematic
SETTINGS_MANAGER m_settingsManager
A simple container for schematic symbol instance information.
@ REFERENCE
Field Reference of part, i.e. "IC21".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
VECTOR2< int32_t > VECTOR2I