KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <pcbnew_utils/board_construction_utils.h>
#include <pcbnew_utils/board_file_utils.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pcb_marker.h>
#include <drc/drc_engine.h>
#include <drc/drc_item.h>
#include <widgets/ui_common.h>
#include <pcbnew_utils/board_test_utils.h>
Go to the source code of this file.
Classes | |
struct | COURTYARD_TEST_FIXTURE |
struct | COURTYARD_INVALID_TEST_FP |
struct | COURTYARD_INVALID_INFO |
struct | COURTYARD_INVALID_CASE |
Functions | |
std::ostream & | operator<< (std::ostream &os, const COURTYARD_INVALID_INFO &aInvalid) |
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. | |
std::unique_ptr< BOARD > | MakeBoard (const std::vector< COURTYARD_INVALID_TEST_FP > &aTestFPDefs) |
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. | |
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. | |
void | DoCourtyardInvalidTest (const COURTYARD_INVALID_CASE &aCase, const KI_TEST::BOARD_DUMPER &aDumper) |
BOOST_AUTO_TEST_CASE (InvalidCases) | |
Variables | |
static const std::vector< COURTYARD_INVALID_CASE > | courtyard_invalid_cases |
BOOST_AUTO_TEST_CASE | ( | InvalidCases | ) |
Definition at line 323 of file test_drc_courtyard_invalid.cpp.
References courtyard_invalid_cases, and DoCourtyardInvalidTest().
|
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.
aMarkers | list of markers produced by the DRC |
aCollisions | list of expected collisions |
Definition at line 269 of file test_drc_courtyard_invalid.cpp.
References KI_TEST::CheckUnorderedMatches(), and InvalidMatchesExpected().
Referenced by DoCourtyardInvalidTest().
void DoCourtyardInvalidTest | ( | const COURTYARD_INVALID_CASE & | aCase, |
const KI_TEST::BOARD_DUMPER & | aDumper | ||
) |
Definition at line 282 of file test_drc_courtyard_invalid.cpp.
References CheckInvalidsMatchExpected(), DRCE_MALFORMED_COURTYARD, DRCE_MISSING_COURTYARD, DRCE_OVERLAPPING_FOOTPRINTS, KI_TEST::BOARD_DUMPER::DumpBoardToFile(), DRC_ENGINE::InitEngine(), COURTYARD_INVALID_CASE::m_case_name, BOARD_DESIGN_SETTINGS::m_DRCSeverities, COURTYARD_INVALID_CASE::m_exp_errors, COURTYARD_INVALID_CASE::m_mods, MakeBoard(), MILLIMETRES, RPT_SEVERITY_ERROR, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Check if a PCB_MARKER is described by a particular COURTYARD_INVALID_INFO object.
Definition at line 233 of file test_drc_courtyard_invalid.cpp.
References BOARD::GetItem(), MARKER_BASE::GetRCItem(), FOOTPRINT::GetReference(), COURTYARD_INVALID_INFO::m_drc_error_code, COURTYARD_INVALID_INFO::m_refdes, and niluuid.
Referenced by CheckInvalidsMatchExpected().
std::unique_ptr< BOARD > MakeBoard | ( | const std::vector< COURTYARD_INVALID_TEST_FP > & | aTestFPDefs | ) |
Definition at line 215 of file test_drc_courtyard_invalid.cpp.
References MakeInvalidCourtyardTestFP().
Referenced by DoCourtyardInvalidTest().
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.
Definition at line 192 of file test_drc_courtyard_invalid.cpp.
References KI_TEST::DrawSegment(), F_CrtYd, COURTYARD_INVALID_TEST_FP::m_pos, COURTYARD_INVALID_TEST_FP::m_refdes, COURTYARD_INVALID_TEST_FP::m_segs, EDA_IU_SCALE::mmToIU(), and pcbIUScale.
Referenced by MakeBoard().
std::ostream & operator<< | ( | std::ostream & | os, |
const COURTYARD_INVALID_INFO & | aInvalid | ||
) |
Definition at line 66 of file test_drc_courtyard_invalid.cpp.
References COURTYARD_INVALID_INFO::m_drc_error_code, COURTYARD_INVALID_INFO::m_refdes, and operator<<().
|
static |
Definition at line 83 of file test_drc_courtyard_invalid.cpp.
Referenced by BOOST_AUTO_TEST_CASE().