KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_drc_courtyard_overlap.cpp File Reference

Go to the source code of this file.

Classes

struct  RECT_DEFINITION
 Simple definition of a rectangle, can be rounded. More...
 
struct  COURTYARD_TEST_FP
 
struct  COURTYARD_COLLISION
 
struct  COURTYARD_OVERLAP_TEST_CASE
 A complete courtyard overlap test case: a name, the board footprint list and the expected collisions. More...
 
struct  COURTYARD_TEST_FIXTURE
 

Functions

std::ostream & operator<< (std::ostream &os, const COURTYARD_COLLISION &aColl)
 
void AddRectCourtyard (FOOTPRINT &aFootprint, const RECT_DEFINITION &aRect)
 Add a rectangular courtyard outline to a footprint.
 
std::unique_ptr< FOOTPRINTMakeCourtyardTestFP (BOARD &aBoard, const COURTYARD_TEST_FP &aFPDef)
 Construct a FOOTPRINT to use in a courtyard test from a COURTYARD_TEST_FP definition.
 
std::unique_ptr< BOARDMakeBoard (const std::vector< COURTYARD_TEST_FP > &aFPDefs)
 Make a board for courtyard testing.
 
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, const KI_TEST::BOARD_DUMPER &aDumper)
 Run a single courtyard overlap testcase.
 
 BOOST_AUTO_TEST_CASE (OverlapCases)
 

Variables

static std::vector< COURTYARD_OVERLAP_TEST_CASEcourtyard_cases
 

Function Documentation

◆ AddRectCourtyard()

void AddRectCourtyard ( FOOTPRINT aFootprint,
const RECT_DEFINITION aRect 
)

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( OverlapCases  )

Definition at line 479 of file test_drc_courtyard_overlap.cpp.

References courtyard_cases, and DoCourtyardOverlapTest().

◆ CheckCollisionsMatchExpected()

static void CheckCollisionsMatchExpected ( BOARD aBoard,
const std::vector< std::unique_ptr< PCB_MARKER > > &  aMarkers,
const std::vector< COURTYARD_COLLISION > &  aExpCollisions 
)
static

Check that the produced markers match the expected.

This does NOT check ordering, as that is not part of the contract of the DRC function.

Parameters
aMarkerslist of markers produced by the DRC
aCollisionslist of expected collisions

Definition at line 418 of file test_drc_courtyard_overlap.cpp.

References KI_TEST::CheckUnorderedMatches(), CollisionMatchesExpected(), DRCE_OVERLAPPING_FOOTPRINTS, and KI_TEST::IsDrcMarkerOfType().

Referenced by DoCourtyardOverlapTest().

◆ CollisionMatchesExpected()

static bool CollisionMatchesExpected ( BOARD aBoard,
const PCB_MARKER aMarker,
const COURTYARD_COLLISION aCollision 
)
static

◆ DoCourtyardOverlapTest()

◆ MakeBoard()

std::unique_ptr< BOARD > MakeBoard ( const std::vector< COURTYARD_TEST_FP > &  aFPDefs)

Make a board for courtyard testing.

Parameters
aFPDefsthe list of footprint definitions to add to the board

Definition at line 130 of file test_drc_courtyard_overlap.cpp.

References MakeCourtyardTestFP().

Referenced by DoCourtyardOverlapTest().

◆ MakeCourtyardTestFP()

std::unique_ptr< FOOTPRINT > MakeCourtyardTestFP ( BOARD aBoard,
const COURTYARD_TEST_FP aFPDef 
)

Construct a FOOTPRINT to use in a courtyard test from a COURTYARD_TEST_FP definition.

Definition at line 110 of file test_drc_courtyard_overlap.cpp.

References AddRectCourtyard(), COURTYARD_TEST_FP::m_pos, COURTYARD_TEST_FP::m_rects, and COURTYARD_TEST_FP::m_refdes.

Referenced by MakeBoard().

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const COURTYARD_COLLISION aColl 
)

Variable Documentation

◆ courtyard_cases

std::vector<COURTYARD_OVERLAP_TEST_CASE> courtyard_cases
static

Definition at line 154 of file test_drc_courtyard_overlap.cpp.

Referenced by BOOST_AUTO_TEST_CASE().