48 m_board->GetDesignSettings().m_DRCEngine->ClearViolationHandler();
58 std::vector<double>
runCreepage(
const std::string& aRelPath )
71 std::vector<std::shared_ptr<DRC_ITEM>> violations;
74 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
78 violations.push_back( aItem );
84 std::regex actualRe( R
"(actual\s+([0-9]+\.[0-9]+)\s*mm)" );
85 std::vector<double> actuals;
87 for(
const std::shared_ptr<DRC_ITEM>& v : violations )
89 std::string msg = v->GetErrorMessage(
false ).ToStdString();
92 if( std::regex_search( msg, m, actualRe ) )
93 actuals.push_back( std::stod( m[1].str() ) );
107 std::vector<double> actuals = runCreepage(
"issue24875/issue24875" );
111 for(
double actual : actuals )
115 "Creepage should wrap the merged slot end (actual " <<
actual <<
" mm)" );
124 std::vector<double> actuals = runCreepage(
"issue24875_fullround/issue24875_fullround" );
128 for(
double actual : actuals )
132 "Creepage should wrap the merged slot end (actual " <<
actual <<
" mm)" );
141 std::vector<double> actuals = runCreepage(
"issue24875_capstraight/issue24875_capstraight" );
145 for(
double actual : actuals )
149 "Cap-over-straight creepage should stay correct (actual " <<
actual <<
" mm)" );
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
SEVERITY GetSeverity(int aDRCErrorCode) const
Return the severity of a given DRC error code.
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 ClearViolationHandler()
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
std::unique_ptr< BOARD > m_board
~DRC_CREEPAGE_ISSUE24875_FIXTURE()
DRC_CREEPAGE_ISSUE24875_FIXTURE()=default
std::vector< double > runCreepage(const std::string &aRelPath)
SETTINGS_MANAGER m_settingsManager
BOOST_REQUIRE_MESSAGE(dc.CacheTableInfo(table, { "part_id", "val" }), dc.GetLastError())
BOOST_FIXTURE_TEST_CASE(CreepageOverlappingCapsIssue24875, DRC_CREEPAGE_ISSUE24875_FIXTURE)
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
VECTOR2< int32_t > VECTOR2I