62 wxS(
"issue24409/issue24409.kicad_sch" );
64 for(
bool useEngine : {
false,
true } )
85 std::set<wxString> seenRefs;
87 for(
size_t i = 0; i < refs.
GetCount(); ++i )
88 seenRefs.insert( refs[i].GetRef() );
106 sch->ConnectionGraph()->RunERC();
109 int unconnectedMarkers = 0;
110 std::set<wxString> markedRefs;
112 std::set<const SCH_SCREEN*> visitedScreens;
119 if( !visitedScreens.insert( screen ).second )
125 std::shared_ptr<ERC_ITEM> ercItem =
126 std::dynamic_pointer_cast<ERC_ITEM>( marker->
GetRCItem() );
131 ++unconnectedMarkers;
134 ? ercItem->GetSpecificSheetPath()
136 EDA_ITEM* erred = sch->ResolveItem( ercItem->GetMainItemID(),
nullptr,
true );
141 markedRefs.insert( parent->GetRef( &markerSheet ) );
149 BOOST_CHECK_MESSAGE( unconnectedMarkers == 4,
150 "Expected 4 deduplicated pin_not_connected markers, got "
151 << unconnectedMarkers );
157 for(
const wxString ref : { wxS(
"R1" ), wxS(
"R2" ) } )
159 BOOST_CHECK_MESSAGE( markedRefs.count( ref ),
160 "Missing pin_not_connected marker for " << ref
161 <<
" on the first sheet instance" );
164 for(
const wxString ref : { wxS(
"R3" ), wxS(
"R4" ), wxS(
"R5" ), wxS(
"R6" ) } )
166 BOOST_CHECK_MESSAGE( !markedRefs.count( ref ),
167 "Unexpected pin_not_connected marker for " << ref
168 <<
"; dedup should keep only the first instance" );
175 std::shared_ptr<SHEETLIST_ERC_ITEMS_PROVIDER> markersProvider =
176 std::make_shared<SHEETLIST_ERC_ITEMS_PROVIDER>( sch.get() );
182 for(
const wxString ref : { wxS(
"R1" ), wxS(
"R2" ) } )
184 BOOST_CHECK_MESSAGE( report.Contains( wxS(
"Symbol " ) + ref + wxS(
" " ) ),
185 "ERC text report missing pin_not_connected for "
186 << ref <<
"\n" << report );
189 for(
const wxString ref : { wxS(
"R3" ), wxS(
"R4" ), wxS(
"R5" ), wxS(
"R6" ) } )
191 BOOST_CHECK_MESSAGE( !report.Contains( wxS(
"Symbol " ) + ref + wxS(
" " ) ),
192 "ERC text report unexpectedly mentions "
193 << ref <<
"\n" << report );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
A base class for most all the KiCad significant classes used in schematics and boards.
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
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
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
std::shared_ptr< RC_ITEM > GetRCItem() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
RAII class that sets an value at construction and resets it to the original value at destruction.
@ ERCE_PIN_NOT_CONNECTED
Pin not connected and not no connect symbol.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
@ SYMBOL_FILTER_NON_POWER
std::vector< FAB_LAYER_COLOR > dummy
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_CASE(Issue24409CliHierarchicalInstances)
BOOST_TEST_CONTEXT("Test Clearance")