68 os <<
"COURTYARD_INVALID_INFO[ " << aInvalid.
m_refdes;
77 std::vector<COURTYARD_INVALID_TEST_FP>
m_mods;
92 "single footprint, no courtyard",
108 "single footprint, unclosed courtyard",
127 "single footprint, disjoint courtyard",
146 "two footprints, one OK, one malformed",
195 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( &aBoard );
205 footprint->SetReference( aFPDef.
m_refdes );
209 footprint->SetPosition( aFPDef.
m_pos );
215std::unique_ptr<BOARD>
MakeBoard(
const std::vector<COURTYARD_INVALID_TEST_FP>& aTestFPDefs )
217 auto board = std::make_unique<BOARD>();
223 board->Add( footprint.release() );
236 auto reporter = std::static_pointer_cast<DRC_ITEM>( aMarker.
GetRCItem() );
240 if( reporter->GetAuxItemID() !=
niluuid )
242 BOOST_WARN_MESSAGE(
false,
"Expected no auxiliary item for invalid courtyard DRC." );
246 if( item_a ==
nullptr )
248 BOOST_ERROR(
"Could not get board DRC item." );
270 const std::vector<std::unique_ptr<PCB_MARKER>>& aMarkers,
271 const std::vector<COURTYARD_INVALID_INFO>& aExpInvalids )
275 const std::unique_ptr<PCB_MARKER>& aMarker )
300 std::vector<std::unique_ptr<PCB_MARKER>> markers;
302 DRC_ENGINE drcEngine( board.get(), &board->GetDesignSettings() );
307 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer,
314 markers.push_back( std::make_unique<PCB_MARKER>( aItem, aPos ) );
328 BOOST_TEST_CONTEXT( c.m_case_name )
constexpr EDA_IU_SCALE pcbIUScale
Construction utilities for PCB tests.
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 * GetItem(const KIID &aID) 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.
A helper that contains logic to assist in dumping boards to disk depending on some environment variab...
void DumpBoardToFile(BOARD &aBoard, const std::string &aName) const
std::shared_ptr< RC_ITEM > GetRCItem() const
std::function< void(PCB_MARKER *aMarker)> DRC_CUSTOM_MARKER_HANDLER
@ DRCE_OVERLAPPING_FOOTPRINTS
@ DRCE_MALFORMED_COURTYARD
std::ostream & operator<<(std::ostream &aStream, const EDA_TEXT &aText)
PCB_LAYER_ID
A quick note on layer IDs:
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.
void DrawSegment(FOOTPRINT &aFootprint, const SEG &aSeg, int aWidth, PCB_LAYER_ID aLayer)
Draw a segment in the given footprint.
std::vector< COURTYARD_INVALID_TEST_FP > m_mods
std::vector< COURTYARD_INVALID_INFO > m_exp_errors
std::vector< SEG > m_segs
Footprint Ref-Des (for identifying DRC errors)
VECTOR2I m_pos
List of segments that will be placed on the courtyard.
const KI_TEST::BOARD_DUMPER m_dumper
constexpr int mmToIU(double mm) const
static const std::vector< COURTYARD_INVALID_CASE > courtyard_invalid_cases
std::unique_ptr< FOOTPRINT > MakeInvalidCourtyardTestFP(BOARD &aBoard, const COURTYARD_INVALID_TEST_FP &aFPDef)
Construct a FOOTPRINT to use in a courtyard test from a COURTYARD_TEST_FP definition.
static bool InvalidMatchesExpected(BOARD &aBoard, const PCB_MARKER &aMarker, const COURTYARD_INVALID_INFO &aInvalid)
Check if a PCB_MARKER is described by a particular COURTYARD_INVALID_INFO object.
std::unique_ptr< BOARD > MakeBoard(const std::vector< COURTYARD_INVALID_TEST_FP > &aTestFPDefs)
void DoCourtyardInvalidTest(const COURTYARD_INVALID_CASE &aCase, const KI_TEST::BOARD_DUMPER &aDumper)
static void CheckInvalidsMatchExpected(BOARD &aBoard, const std::vector< std::unique_ptr< PCB_MARKER > > &aMarkers, const std::vector< COURTYARD_INVALID_INFO > &aExpInvalids)
Check that the produced markers match the expected.
BOOST_AUTO_TEST_CASE(InvalidCases)
BOOST_AUTO_TEST_SUITE_END()
Functions to provide common constants and other functions to assist in making a consistent UI.