38#include <wx/filename.h>
63 +
"plugins/eagle/Adafruit-AHT20-PCB/"
64 "Adafruit AHT20 Temperature & Humidity.brd";
66 BOOST_REQUIRE_MESSAGE( wxFileName::FileExists( dataPath ),
67 "Test board file not found: " + dataPath );
70 BOARD* rawBoard =
nullptr;
74 rawBoard = eaglePlugin.
LoadBoard( dataPath,
nullptr,
nullptr );
78 BOOST_FAIL(
"IO_ERROR loading Eagle board: " + e.
What().ToStdString() );
80 catch(
const std::exception& e )
82 BOOST_FAIL( std::string(
"Exception loading Eagle board: " ) + e.
what() );
85 std::unique_ptr<BOARD> board( rawBoard );
90 std::map<wxString, int> viasPerNet;
100 viasPerNet[netName]++;
105 BOOST_CHECK_GT( viasPerNet[wxT(
"SDA" )], 0 );
106 BOOST_CHECK_GT( viasPerNet[wxT(
"SCL" )], 0 );
107 BOOST_CHECK_GT( viasPerNet[wxT(
"GND" )], 0 );
108 BOOST_CHECK_GT( viasPerNet[wxT(
"VCC" )], 0 );
109 BOOST_CHECK_GT( viasPerNet[wxT(
"VDD" )], 0 );
139 +
"plugins/eagle/test_eagle_23016/test_eagle.brd";
141 BOOST_REQUIRE_MESSAGE( wxFileName::FileExists( dataPath ),
142 "Test board file not found: " + dataPath );
145 BOARD* rawBoard =
nullptr;
149 rawBoard = eaglePlugin.
LoadBoard( dataPath,
nullptr,
nullptr );
153 BOOST_FAIL(
"IO_ERROR loading Eagle board: " + e.
What().ToStdString() );
155 catch(
const std::exception& e )
157 BOOST_FAIL( std::string(
"Exception loading Eagle board: " ) + e.
what() );
160 std::unique_ptr<BOARD> board( rawBoard );
173 for(
FOOTPRINT* fp : board->Footprints() )
175 wxString ref = fp->GetReference();
177 if( ref == wxT(
"I2C0" ) || ref == wxT(
"I2C1" ) )
179 PCB_TEXT& refText = fp->Reference();
183 ref +
" reference horizontal justification should be RIGHT, got "
188 ref +
" reference vertical justification should be TOP, got "
196 int topPinLabelCount = 0;
205 if(
text->GetText() != wxT(
"G SDA SCL V+" ) )
215 "Pin label text horizontal justification should be LEFT" );
219 "Pin label text vertical justification should be BOTTOM" );
223 "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_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
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