51 std::vector<std::pair<wxString, int>> tests = {
52 {
"length_calculations", 0 },
53 {
"time_calculations", 1 },
57 for(
const std::pair<wxString, int>&
test : tests )
62 std::vector<DRC_ITEM> violations;
82 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
83 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
86 violations.push_back( *aItem );
91 if( violations.size() ==
test.second )
101 std::map<KIID, EDA_ITEM*> itemMap;
102 m_board->FillItemMap( itemMap );
104 for(
const DRC_ITEM& item : violations )
107 BOOST_ERROR( wxString::Format(
"DRC lengths: %s\n"
108 "%d violations found (expected %d)\n"
111 (
int) violations.size(),
132 NETINFO_ITEM* net3 = m_board->FindNet(
"Net-(J1-Pin_3)" );
137 for(
PCB_TRACK* track : m_board->Tracks() )
142 if( track->GetNetCode() != net3->
GetNetCode() )
153 auto [startLayer, endLayer] = item.
GetLayers();
constexpr EDA_IU_SCALE pcbIUScale
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
SEVERITY GetSeverity(int aDRCErrorCode)
void RunTests(EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aTestFootprints, BOARD_COMMIT *aCommit=nullptr)
Run the DRC tests.
void SetViolationHandler(DRC_VIOLATION_HANDLER aHandler)
Set an optional DRC violation handler (receives DRC_ITEMs and positions).
Lightweight class which holds a pad, via, or a routed trace outline.
std::tuple< PCB_LAYER_ID, PCB_LAYER_ID > GetLayers() const
Gets the upper and lower layers for the proxied item.
Class which calculates lengths (and associated routing statistics) in a BOARD context.
LENGTH_DELAY_CALCULATION_ITEM GetLengthCalculationItem(const BOARD_CONNECTED_ITEM *aBoardItem) const
Return a LENGTH_CALCULATION_ITEM constructed from the given BOARD_CONNECTED_ITEM.
Handle the data for a net.
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_LENGTH_OUT_OF_RANGE
@ DRCE_LIB_FOOTPRINT_MISMATCH
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
void FillZones(BOARD *m_board)
SETTINGS_MANAGER m_settingsManager
DRC_REGRESSION_TEST_FIXTURE()
std::unique_ptr< BOARD > m_board
BOOST_FIXTURE_TEST_CASE(DRCLengths, DRC_REGRESSION_TEST_FIXTURE)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
VECTOR2< int32_t > VECTOR2I