42#include <wx/filename.h>
67 +
"plugins/eagle/Adafruit-AHT20-PCB/"
68 "Adafruit AHT20 Temperature & Humidity.brd";
70 BOOST_REQUIRE_MESSAGE( wxFileName::FileExists( dataPath ),
71 "Test board file not found: " + dataPath );
74 BOARD* rawBoard =
nullptr;
78 rawBoard = eaglePlugin.
LoadBoard( dataPath,
nullptr,
nullptr );
82 BOOST_FAIL(
"IO_ERROR loading Eagle board: " + e.
What().ToStdString() );
84 catch(
const std::exception& e )
86 BOOST_FAIL( std::string(
"Exception loading Eagle board: " ) + e.
what() );
89 std::unique_ptr<BOARD> board( rawBoard );
94 std::map<wxString, int> viasPerNet;
104 viasPerNet[netName]++;
109 BOOST_CHECK_GT( viasPerNet[wxT(
"SDA" )], 0 );
110 BOOST_CHECK_GT( viasPerNet[wxT(
"SCL" )], 0 );
111 BOOST_CHECK_GT( viasPerNet[wxT(
"GND" )], 0 );
112 BOOST_CHECK_GT( viasPerNet[wxT(
"VCC" )], 0 );
113 BOOST_CHECK_GT( viasPerNet[wxT(
"VDD" )], 0 );
143 +
"plugins/eagle/test_eagle_23016/test_eagle.brd";
145 BOOST_REQUIRE_MESSAGE( wxFileName::FileExists( dataPath ),
146 "Test board file not found: " + dataPath );
149 BOARD* rawBoard =
nullptr;
153 rawBoard = eaglePlugin.
LoadBoard( dataPath,
nullptr,
nullptr );
157 BOOST_FAIL(
"IO_ERROR loading Eagle board: " + e.
What().ToStdString() );
159 catch(
const std::exception& e )
161 BOOST_FAIL( std::string(
"Exception loading Eagle board: " ) + e.
what() );
164 std::unique_ptr<BOARD> board( rawBoard );
177 for(
FOOTPRINT* fp : board->Footprints() )
179 wxString ref = fp->GetReference();
181 if( ref == wxT(
"I2C0" ) || ref == wxT(
"I2C1" ) )
183 PCB_TEXT& refText = fp->Reference();
187 ref +
" reference horizontal justification should be RIGHT, got "
192 ref +
" reference vertical justification should be TOP, got "
200 int topPinLabelCount = 0;
209 if(
text->GetText() != wxT(
"G SDA SCL V+" ) )
219 "Pin label text horizontal justification should be LEFT" );
223 "Pin label text vertical justification should be BOTTOM" );
227 "Pin label text angle should be 90 degrees" );
General utilities for PCB file IO for QA programs.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
GR_TEXT_H_ALIGN_T GetHorizJustify() const
GR_TEXT_V_ALIGN_T GetVertJustify() const
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
Handle the data for a net.
const wxString & GetNetname() const
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.
EAGLE_BOARD_IMPORT_FIXTURE()
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(ViaNetAssignment)
Verify that vias imported from an Eagle board are assigned to the correct nets.
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TEXT_T
class PCB_TEXT, text on a layer