53 std::vector<std::pair<wxString, int>> tests = {
54 {
"length_calculations", 0 },
55 {
"time_calculations", 1 },
59 for(
const std::pair<wxString, int>&
test : tests )
64 std::vector<DRC_ITEM> violations;
84 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
85 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
88 violations.push_back( *aItem );
93 if( violations.size() ==
test.second )
103 std::map<KIID, EDA_ITEM*> itemMap;
104 m_board->FillItemMap( itemMap );
106 for(
const DRC_ITEM& item : violations )
109 BOOST_ERROR( wxString::Format(
"DRC lengths: %s\n"
110 "%d violations found (expected %d)\n"
113 (
int) violations.size(),
134 NETINFO_ITEM* net3 = m_board->FindNet(
"Net-(J1-Pin_3)" );
139 for(
PCB_TRACK* track : m_board->Tracks() )
144 if( track->GetNetCode() != net3->
GetNetCode() )
155 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