53 std::vector<DRC_ITEM> violations;
68 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
69 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
72 violations.push_back( *aItem );
77 int trackViolations = 0;
78 int viaViolations = 0;
80 std::map<KIID, EDA_ITEM*> itemMap;
81 m_board->FillItemMap( itemMap );
83 for(
const DRC_ITEM& item : violations )
85 const KIID id = item.GetMainItemID();
90 auto it = itemMap.find(
id );
92 if( it == itemMap.end() )
95 switch( it->second->Type() )
105 "Expected exactly 2 via keepout violations, got "
106 << viaViolations <<
" (total: " << violations.size() <<
")" );
108 "Expected exactly 1 track keepout violation, got "
109 << trackViolations );
111 "Expected exactly 3 DRCE_ALLOWED_ITEMS violations, got "
112 << violations.size() );
114 if( viaViolations != 2 || trackViolations != 1 || violations.size() != 3 )
118 for(
const DRC_ITEM& item : violations )
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
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).
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_LIB_FOOTPRINT_MISMATCH
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< BOARD > m_board
DRC_KEEPOUT_TEST_FIXTURE()
BOOST_FIXTURE_TEST_CASE(DRCKeepoutDisallowViasAndTracks, DRC_KEEPOUT_TEST_FIXTURE)
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I