47#include <wx/filename.h>
56 +
"plugins/eagle/issue18515_managed_lib.brd";
58 BOOST_REQUIRE_MESSAGE( wxFileName::FileExists( dataPath ),
59 "Test board file not found: " + dataPath );
63 wxFileName rulesFn( dataPath );
64 rulesFn.SetExt( wxT(
"kicad_dru" ) );
66 BOOST_REQUIRE_MESSAGE( !rulesFn.FileExists(),
67 "Stale rules sidecar present before load: "
68 + rulesFn.GetFullPath().ToStdString() );
71 BOARD* rawBoard =
nullptr;
75 rawBoard = eaglePlugin.
LoadBoard( dataPath,
nullptr,
nullptr );
79 BOOST_FAIL(
"IO_ERROR loading Eagle board: " + e.
What().ToStdString() );
81 catch(
const std::exception& e )
83 BOOST_FAIL( std::string(
"Exception loading Eagle board: " ) + e.
what() );
86 std::unique_ptr<BOARD> board( rawBoard );
91 BOOST_REQUIRE_EQUAL( board->Footprints().size(), 2 );
96 for(
FOOTPRINT* fp : board->Footprints() )
98 const wxString itemName = fp->GetFPID().GetUniStringLibItemName();
103 !itemName.Contains( wxT(
"_38243636" ) ),
104 "Footprint name '" + itemName.ToStdString()
105 +
"' should not carry the Eagle library URN ordinal." );
107 if( itemName == wxT(
"LED-0603" ) )
109 else if( itemName == wxT(
"R0603" ) )
118 if( rulesFn.FileExists() )
120 wxRemoveFile( rulesFn.GetFullPath() );
121 BOOST_ERROR(
"Importer wrote an empty rules sidecar: "
122 + rulesFn.GetFullPath().ToStdString() );
General utilities for PCB file IO for QA programs.
Information pertinent to a Pcbnew printed circuit board.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
virtual const char * what() const override
std::exception interface, returned as UTF-8
Works with Eagle 6.x XML board files and footprints to implement the Pcbnew #PLUGIN API or a portion ...
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
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_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")