58 for(
RULE_AREA& ra : aTool->GetData()->m_areas )
60 if( ra.m_ruleName.Contains( ( aName ) ) )
72 std::vector<wxString> tests = {
"vme-wren" };
74 for(
const wxString& relPath : tests )
81 toolMgr.
SetEnvironment( m_board.get(),
nullptr,
nullptr,
nullptr, toolsHolder );
90 auto ruleData = mtTool->
GetData();
92 BOOST_TEST_MESSAGE( wxString::Format(
"RA multichannel sheets = %d",
93 static_cast<int>( ruleData->m_areas.size() ) ) );
95 BOOST_CHECK_EQUAL( ruleData->m_areas.size(), 72 );
99 ruleData->m_replaceExisting =
true;
104 || ra.
m_sheetName == wxT(
"pp_driver_2x.kicad_sch" ) )
111 BOOST_TEST_MESSAGE( wxString::Format(
"Autogenerating %d RAs", cnt ) );
118 int n_areas_io = 0, n_areas_pp = 0, n_areas_other = 0;
120 BOOST_TEST_MESSAGE( wxString::Format(
"Found %d RAs after commit",
121 static_cast<int>(ruleData->m_areas.size() ) ) );
123 for(
const RULE_AREA& ra : ruleData->m_areas )
125 BOOST_TEST_MESSAGE( wxString::Format(
"SN '%s'", ra.
m_ruleName ) );
127 if( ra.
m_ruleName.Contains( wxT(
"io_drivers_fp" ) ) )
132 else if( ra.
m_ruleName.Contains( wxT(
"io_drivers_pp" ) ) )
143 BOOST_TEST_MESSAGE( wxString::Format(
"IO areas=%d, PP areas=%d, others=%d",
144 n_areas_io, n_areas_pp, n_areas_other ) );
146 BOOST_CHECK_EQUAL( n_areas_io, 16 );
147 BOOST_CHECK_EQUAL( n_areas_pp, 16 );
148 BOOST_CHECK_EQUAL( n_areas_other, 0 );
150 const std::vector<wxString> rulesToTest = { wxT(
"io_drivers_fp" ),
151 wxT(
"io_drivers_pp" ) };
153 for(
const wxString& ruleName : rulesToTest )
155 for(
const RULE_AREA& refArea : ruleData->m_areas )
157 if( !refArea.
m_ruleName.Contains( ruleName ) )
160 BOOST_TEST_MESSAGE( wxString::Format(
"REF AREA: '%s'", refArea.
m_ruleName ) );
162 for(
const RULE_AREA& targetArea : ruleData->m_areas )
167 if( !targetArea.
m_ruleName.Contains( ruleName ) )
170 auto cgRef = CONNECTION_GRAPH::BuildFromFootprintSet( refArea.
m_raFootprints );
172 CONNECTION_GRAPH::BuildFromFootprintSet( targetArea.
m_raFootprints );
176 CONNECTION_GRAPH::STATUS status =
177 cgRef->FindIsomorphism( cgTarget.get(), result );
179 BOOST_TEST_MESSAGE( wxString::Format(
180 "topo match: '%s' [%d] -> '%s' [%d] result %d",
186 for(
const auto& iter : result )
188 BOOST_TEST_MESSAGE( wxString::Format(
"%s : %s",
189 iter.second->GetReference(),
190 iter.first->GetReference() ) );
200 BOOST_ASSERT( refArea );
202 const std::vector<wxString> targetAreaNames( { wxT(
"io_drivers_fp/bank2/io78/" ),
203 wxT(
"io_drivers_fp/bank1/io78/" ),
204 wxT(
"io_drivers_fp/bank0/io01/" ) } );
206 for(
const wxString& targetRaName : targetAreaNames )
210 BOOST_ASSERT( targetRA !=
nullptr );
212 BOOST_TEST_MESSAGE( wxString::Format(
"Clone to: %s", targetRA->m_ruleName ) );
214 ruleData->m_compatMap[targetRA].m_doCopy =
true;
219 BOOST_ASSERT( result >= 0 );
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
std::map< FOOTPRINT *, FOOTPRINT * > COMPONENT_MATCHES
MULTICHANNEL_TEST_FIXTURE()
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< BOARD > m_board
std::set< FOOTPRINT * > m_raFootprints
BOOST_AUTO_TEST_SUITE_END()
RULE_AREA * findRuleAreaByPartialName(MULTICHANNEL_TOOL *aTool, const wxString &aName)
BOOST_FIXTURE_TEST_CASE(MultichannelToolRegressions, MULTICHANNEL_TEST_FIXTURE)