40struct ERC_REGRESSION_TEST_FIXTURE
42 ERC_REGRESSION_TEST_FIXTURE()
45 SETTINGS_MANAGER m_settingsManager;
46 std::unique_ptr<SCHEMATIC> m_schematic;
56 std::vector<std::pair<wxString, int>> tests =
61 for(
const std::pair<wxString, int>&
test : tests )
78 "Expected " <<
test.second <<
" errors in " <<
test.first.ToStdString()
79 <<
" but got " << errors.
GetCount() <<
"\n"
92 std::unique_ptr<SCHEMATIC> schematic;
97 std::vector<SCH_ITEM*> markers;
101 auto* marker =
static_cast<SCH_MARKER*
>( item );
103 BOOST_REQUIRE_GE( ids.size(), 3 );
104 std::sort( ids.begin() + 1, ids.end(), std::greater<KIID>() );
105 marker->GetRCItem()->SetItems( ids );
106 marker->SetExcluded(
true,
"Retained crossing" );
107 markers.push_back( item );
110 schematic->RecordERCExclusions();
116 schematic->RebuildConnectivity();
118 schematic->ResolveERCExclusionsPostUpdate();
123 const auto* marker =
static_cast<SCH_MARKER*
>( item );
124 BOOST_CHECK( marker->IsExcluded() );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
EE_TYPE OfType(KICAD_T aType) const
wxString GetTextReport()
Returns the ERC report in "text" (human readable) format in the C-locale.
Container for ERC settings.
std::map< int, SEVERITY > m_ERCSeverities
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
int TestLabelMultipleWires()
Test to see if there are labels that are connected to more than one wire.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
std::shared_ptr< RC_ITEM > GetRCItem() const
std::vector< KIID > GetIDs() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
void DeleteItem(SCH_ITEM *aItem)
Remove aItem from the linked list and deletes the object.
RAII class that sets an value at construction and resets it to the original value at destruction.
An implementation of the RC_ITEM_LIST interface which uses the global SHEETLIST to fulfill the contra...
int GetCount(int aSeverity=-1) const override
void SetSeverities(int aSeverities) override
@ ERCE_LABEL_MULTIPLE_WIRES
A label is connected to more than one wire.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::vector< FAB_LAYER_COLOR > dummy
BOOST_AUTO_TEST_CASE(ERCMultipleWireExclusionsSurviveCanonicalWitnesses)
BOOST_FIXTURE_TEST_CASE(ERCLabelMultipleWires, ERC_REGRESSION_TEST_FIXTURE)
BOOST_CHECK_EQUAL(result, "25.4")