51 std::vector<wxString> tests =
66 "unconnected-netnames/unconnected-netnames",
69 for(
const wxString& relPath : tests )
74 std::vector<DRC_ITEM> violations;
88 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer )
91 violations.push_back( *aItem );
96 if( violations.empty() )
98 BOOST_CHECK_EQUAL( 1, 1 );
99 BOOST_TEST_MESSAGE( wxString::Format(
"DRC regression: %s, passed", relPath ) );
105 std::map<KIID, EDA_ITEM*> itemMap;
106 m_board->FillItemMap( itemMap );
108 for(
const DRC_ITEM& item : violations )
114 BOOST_ERROR( wxString::Format(
"DRC regression: %s, failed (err: expected 0 found %d",
115 relPath, (
int)violations.size() ) );
125 std::vector< std::pair<wxString, int> > tests =
143 {
"reverse_via", 3 },
144 {
"intersectingzones", 1 },
146 {
"issue17967/issue17967", 1}
149 for(
const auto& [testName, expectedErrors] : tests )
151 BOOST_TEST_CONTEXT( testName )
156 std::vector<PCB_MARKER> markers;
157 std::vector<DRC_ITEM> violations;
166 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer )
168 markers.emplace_back(
PCB_MARKER( aItem, aPos ) );
173 violations.push_back( *aItem );
179 if( violations.size() == expectedErrors )
181 BOOST_CHECK_EQUAL( 1, 1 );
182 BOOST_TEST_MESSAGE( wxString::Format(
"DRC regression: %s, passed", testName ) );
188 std::map<KIID, EDA_ITEM*> itemMap;
189 m_board->FillItemMap( itemMap );
191 for(
const DRC_ITEM& item : violations )
197 BOOST_CHECK_EQUAL( violations.size(), expectedErrors );
199 BOOST_ERROR( wxString::Format(
"DRC regression: %s, failed", testName ) );
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
std::set< wxString > m_DrcExclusions
SEVERITY GetSeverity(int aDRCErrorCode)
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_LIB_FOOTPRINT_MISMATCH
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
SETTINGS_MANAGER m_settingsManager
DRC_REGRESSION_TEST_FIXTURE()
std::unique_ptr< BOARD > m_board
BOOST_FIXTURE_TEST_CASE(DRCFalsePositiveRegressions, DRC_REGRESSION_TEST_FIXTURE)