72 "single_empty_footprint",
77 "single_footprint_single_courtyard",
81 "two_footprints_no_overlap",
85 "two_footprints_touching",
89 "two_footprints_overlap",
95 "two_footprints_overlap_different_sides",
99 "two_footprints_multiple_courtyards_overlap",
106 "two_footprints_bbox_overlap_only",
125 if( !item_a || !item_b )
135 return ref_match_aa_bb || ref_match_ab_ba;
147 const std::vector<std::unique_ptr<PCB_MARKER>>& aMarkers,
148 const std::vector<COURTYARD_COLLISION>& aExpCollisions )
150 for(
const auto& marker : aMarkers )
185 std::vector<std::unique_ptr<PCB_MARKER>> markers;
187 DRC_ENGINE drcEngine( board.get(), &board->GetDesignSettings() );
192 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
193 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
199 markers.push_back( std::make_unique<PCB_MARKER>( aItem, aPos ) );
General utilities for PCB file IO for QA programs.
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
Information pertinent to a Pcbnew printed circuit board.
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
Design Rule Checker object that performs all the DRC tests.
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).
void InitEngine(const wxFileName &aRulePath)
Initialize the DRC engine.
std::shared_ptr< RC_ITEM > GetRCItem() const
@ DRCE_OVERLAPPING_FOOTPRINTS
@ DRCE_MALFORMED_COURTYARD
General utilities for DRC-related PCB tests.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
void CheckUnorderedMatches(const EXP_CONT &aExpected, const FOUND_CONT &aFound, MATCH_PRED aMatchPredicate)
Check that a container of "found" objects matches a container of "expected" objects.
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
bool IsDrcMarkerOfType(const PCB_MARKER &aMarker, int aErrorCode)
Predicate for testing the type of a DRC marker.
A complete courtyard overlap test case: the board fixture to load and the expected collisions.
std::vector< COURTYARD_COLLISION > m_collisions
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
static bool CollisionMatchesExpected(BOARD &aBoard, const PCB_MARKER &aMarker, const COURTYARD_COLLISION &aCollision)
Check if a PCB_MARKER is described by a particular COURTYARD_COLLISION object.
static void CheckCollisionsMatchExpected(BOARD &aBoard, const std::vector< std::unique_ptr< PCB_MARKER > > &aMarkers, const std::vector< COURTYARD_COLLISION > &aExpCollisions)
Check that the produced markers match the expected.
static void DoCourtyardOverlapTest(const COURTYARD_OVERLAP_TEST_CASE &aCase)
Run a single courtyard overlap testcase.
BOOST_AUTO_TEST_CASE(OverlapCases)
static std::vector< COURTYARD_OVERLAP_TEST_CASE > courtyard_cases
std::ostream & operator<<(std::ostream &os, const COURTYARD_COLLISION &aColl)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
IbisParser parser & reporter
BOOST_CHECK_PREDICATE(ArePolylineEndPointsNearCircle,(chain)(c.m_geom.m_center_point)(radius)(accuracy+epsilon))
BOOST_TEST_CONTEXT("Test Clearance")
Functions to provide common constants and other functions to assist in making a consistent UI.
VECTOR2< int32_t > VECTOR2I