62 +
"plugins/altium/eDP_adapter_dvt1_source/eDP_adapter_dvt1.PcbDoc";
64 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
67 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
72 BOOST_CHECK( board->GetNetCount() > 0 );
73 BOOST_CHECK( board->Footprints().size() > 0 );
89 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
91 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
96 std::shared_ptr<NET_SETTINGS> netSettings = board->GetDesignSettings().m_NetSettings;
101 auto& patternAssignments = netSettings->GetNetclassPatternAssignments();
104 BOOST_REQUIRE_MESSAGE( patternAssignments.size() > 0,
105 "Test file must have netclass pattern assignments" );
109 bool foundAssignedNet =
false;
113 if( net->GetNetCode() <= 0 )
117 NETCLASS* directNetclass = net->GetNetClass();
120 std::shared_ptr<NETCLASS> effectiveNetclass =
121 netSettings->GetEffectiveNetClass( net->GetNetname() );
128 directNetclass !=
nullptr,
129 wxString::Format(
"Net '%s' should have a direct netclass assignment",
130 net->GetNetname() ) );
134 foundAssignedNet =
true;
140 wxString::Format(
"Net '%s' should not have default netclass, "
141 "expected effective class or component",
142 net->GetNetname() ) );
149 "At least one net should have a non-default netclass assigned" );
159 const std::string& aRelativePath )
163 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
164 aPlugin.
LoadBoard( dataPath, board.get(),
nullptr );
168 int fillZoneCount = 0;
169 int fillZonesWithClearance = 0;
171 for(
ZONE* zone : board->Zones() )
173 if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() || zone->IsTeardropArea() )
178 if( zone->GetLocalClearance().has_value() && zone->GetLocalClearance().value() > 0 )
179 fillZonesWithClearance++;
182 BOOST_CHECK_GT( fillZoneCount, 0 );
185 wxString::Format(
"%s: %d/%d copper fill zones have clearance set",
186 aRelativePath, fillZonesWithClearance,
194 m_altiumPlugin,
"plugins/altium/eDP_adapter_dvt1_source/eDP_adapter_dvt1.PcbDoc" );
201 "plugins/altium/HiFive/HiFive1.B01.PcbDoc" );
246 auto makeRule = [](
int aPriority,
const wxString& aScope1,
const wxString& aScope2,
258 std::vector<ARULE6> rules = {
259 makeRule( 1, wxT(
"InPolygon And InNet('GND')" ), wxT(
"All" ), 100 ),
260 makeRule( 2, wxT(
"InPolygon" ), wxT(
"All" ), 200 ),
261 makeRule( 3, wxT(
"All" ), wxT(
"All" ), 300 ),
262 makeRule( 4, wxT(
"All" ), wxT(
"All" ), 400 ),
270 rules.erase( rules.begin() );
276 rules.erase( rules.begin() );
bool altiumScopeExprMatchesPolygon(const wxString &aExpr)
Return true if an Altium rule scope expression targets polygon pour primitives (matches InPolygon,...
const ARULE6 * selectAltiumPolygonRule(const std::vector< ARULE6 > &aRulesByPriorityAsc)
Select the highest Altium-priority rule whose scope references polygons.
General utilities for PCB file IO for QA programs.
A collection of nets and the parameters used to route or test these nets.
static const char Default[]
the name of the default NETCLASS
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Handle the data for a net.
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
Handle a list of polygons defining a copper zone.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
ALTIUM_PCB_IMPORT_FIXTURE()
PCB_IO_ALTIUM_DESIGNER m_altiumPlugin
BOOST_AUTO_TEST_CASE(BoardLoadNoAssertions)
Test basic board loading - verifies that the Altium import doesn't trigger any assertions during the ...
static void checkAllCopperFillZonesHaveClearance(PCB_IO_ALTIUM_DESIGNER &aPlugin, const std::string &aRelativePath)
Verify that copper zones in imported Altium boards have non-zero local clearance values derived from ...
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_CHECK_EQUAL(result, "25.4")