|
KiCad PCB EDA Suite
|
Test suite for import of Cadence Allegro PCB .brd files. More...
#include "allegro_test_utils.h"#include <pcbnew_utils/board_test_utils.h>#include <pcbnew_utils/board_file_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcbnew/pcb_io/allegro/pcb_io_allegro.h>#include <board.h>#include <geometry/shape_utils.h>#include <footprint.h>#include <pad.h>#include <pcb_shape.h>#include <pcb_text.h>#include <pcb_track.h>#include <zone.h>#include <netinfo.h>#include <netclass.h>#include <board_design_settings.h>#include <project/net_settings.h>#include <reporter.h>#include <filesystem>#include <fstream>#include <map>#include <set>Go to the source code of this file.
Classes | |
| struct | ALLEGRO_IMPORT_FIXTURE |
| struct | ALLEGRO_BOARD_TEST_CASE |
| Data for parameterized all-boards test. More... | |
| struct | ALLEGRO_COMPREHENSIVE_FIXTURE |
| Fixture for comprehensive board import tests with error capturing. More... | |
| struct | ALG_ZONE_POLYGON |
| Parse a FabMaster .alg file and extract reference data for cross-validation. More... | |
| struct | ALG_REFERENCE_DATA |
| struct | BRD_ALG_PAIR |
| struct | ALG_OUTLINE_DATA |
| Parse board outline geometry from a .alg ASCII reference file. More... | |
| struct | ALG_OUTLINE_DATA::OUTLINE_SEGMENT |
Functions | |
| BOOST_AUTO_TEST_CASE (FootprintRefDes) | |
| Test that footprints have valid reference designators. | |
| BOOST_AUTO_TEST_CASE (PadSizes) | |
| Test that pads have valid sizes and are not degenerate. | |
| BOOST_AUTO_TEST_CASE (ViaSizes) | |
| Test that vias have valid sizes (not hardcoded fallback values). | |
| BOOST_AUTO_TEST_CASE (TrackWidths) | |
| Test that track widths are reasonable. | |
| BOOST_AUTO_TEST_CASE (PadNumbers) | |
| Test that pad numbers are set correctly. | |
| static unsigned | CountOutlineElements (const BOARD &board) |
| static void | AssertOutlineValid (const BOARD &aBoard) |
| BOOST_AUTO_TEST_CASE (BoardOutline) | |
| Test that board outline is imported correctly. | |
| BOOST_AUTO_TEST_CASE (PadsInsideOutline) | |
| Test that all pads are inside the board outline. | |
| BOOST_AUTO_TEST_CASE (PreV16FileRejection) | |
| Verify that pre-v16 Allegro files are rejected with an informative error message rather than an opaque "Unknown Allegro file version" error. | |
| BOOST_AUTO_TEST_CASE (RectsZoneVsCopperPolygon) | |
| Test that rects.brd imports one zone fill (left rectangle) and one standalone copper polygon with a net (right rectangle). | |
| BOOST_AUTO_TEST_CASE (CopperText) | |
| Test that copper_text.brd imports the "TESTING" text on F.Cu. | |
| BOOST_AUTO_TEST_CASE (BeagleBone_OutermostZoneNets) | |
| Verify that the outermost (largest area) zone on each copper layer of BeagleBone Black is assigned the GND_EARTH net. | |
| BOOST_AUTO_TEST_CASE (PadSizesPositive) | |
| Verify that all pads have positive sizes (no negative dimensions). | |
| BOOST_AUTO_TEST_CASE (ViaDrillNotLargerThanSize) | |
| Verify that via drill sizes are not larger than via diameters. | |
| BOOST_AUTO_TEST_CASE (SmdPadDetection) | |
| Verify that pads with no drill hole are properly marked as SMD. | |
| BOOST_AUTO_TEST_CASE (QuadPackagePadRotation) | |
| Verify that pads on quad flat packages (QFN/QFP) have proper rotation. | |
| BOOST_AUTO_TEST_CASE (FootprintLayerPlacement) | |
| Verify that footprints are placed on the correct layer. | |
| BOOST_AUTO_TEST_CASE (ArcConnectivity) | |
| Verify that arc start points connect to adjacent track endpoints. | |
| static std::vector< BRD_ALG_PAIR > | getBoardsWithAlg () |
| Get a list of all board files in the test data that have a corresponding .alg reference file. | |
| BOOST_AUTO_TEST_CASE (AlgReferenceNetNames) | |
| Cross-validate imported board net names against .alg ASCII reference export. | |
| BOOST_AUTO_TEST_CASE (AlgReferenceComponentPlacement) | |
| Cross-validate imported board component reference designators against .alg reference. | |
| BOOST_AUTO_TEST_CASE (AllTracksPositiveWidth) | |
| Verify that all tracks and arcs have positive width across all boards. | |
| BOOST_AUTO_TEST_CASE (OutlineSegmentCount) | |
| Compare board outline segment count from binary import against .alg reference. | |
| BOOST_AUTO_TEST_CASE (OutlineBoundingBox) | |
| Compare board bounding box from binary import against .alg outline coordinates. | |
| BOOST_AUTO_TEST_CASE (OutlineEndpoints) | |
| For boards with line-only outlines, verify each segment endpoint matches the .alg reference within tolerance. | |
| BOOST_AUTO_TEST_CASE (PadDrillConsistency) | |
| Verify PTH pads have nonzero drill and SMD pads have zero drill across all boards. | |
| BOOST_AUTO_TEST_CASE (ZoneCountMatchesAlg) | |
| Cross-validate the number of copper zones against .alg ETCH SHAPE records. | |
| BOOST_AUTO_TEST_CASE (ZoneLayerDistribution) | |
| Cross-validate how many zones appear on each copper layer. | |
| BOOST_AUTO_TEST_CASE (ZoneBoundingBoxes) | |
| Cross-validate zone bounding box sizes between binary import and .alg reference. | |
| BOOST_AUTO_TEST_CASE (PadContainedInFabOutline) | |
| Verify that footprint pads are contained within their F.Fab outline bounding box. | |
| BOOST_AUTO_TEST_CASE (PadOrientationP6P10) | |
| Verify pad orientation on footprints P6 and P10. | |
| BOOST_AUTO_TEST_CASE (SlotHoles) | |
| Verify that oblong (slot) drill holes are imported with the correct shape and dimensions. | |
| BOOST_AUTO_TEST_CASE (FootprintOrientation) | |
| Verify that footprint J1 in BeagleBone_Black_RevC imports at 180 degrees orientation. | |
| BOOST_AUTO_TEST_CASE (UIImportPath_NullBoard) | |
| Test that LoadBoard works when aAppendToMe is nullptr, which is the path used by the KiCad UI "Import Non-KiCad Board" flow. | |
| BOOST_AUTO_TEST_CASE (SmdPadLayerConsistency) | |
| Verify that SMD pad layer sets are consistent with their parent footprint side. | |
| BOOST_AUTO_TEST_CASE (SmdFootprintTechLayers) | |
| Verify that SMD-only footprint tech layers are consistent with the footprint side. | |
| BOOST_AUTO_TEST_CASE (BeagleBone_DrillSlotOrientation) | |
| Verify that oblong drill slots on BeagleBone connectors align with their copper pad orientation. | |
| BOOST_AUTO_TEST_CASE (BeagleBone_ZoneFills) | |
| Verify that zones on BeagleBone have fill polygons imported from Allegro's computed copper. | |
| BOOST_AUTO_TEST_CASE (BeagleBone_Teardrops) | |
| Verify that Allegro dynamic copper shapes (m_Unknown2 bit 12) are imported as teardrop zones, and that the pads/vias anchoring those teardrops have teardrops enabled. | |
| BOOST_AUTO_TEST_CASE (PreV172_NoTeardrops) | |
| Verify that pre-V172 boards (which lack the m_Unknown2 discriminator field) have no teardrop zones and no pads/vias with teardrops enabled. | |
| BOOST_AUTO_TEST_CASE (LegacyNetclassFlags) | |
| Verify that the importer sets the legacy netclass and design settings flags so that netclasses survive the SetProject() call during UI import (which replaces m_NetSettings with the project's version unless these flags are set). | |
| BOOST_AUTO_TEST_CASE (NetclassesCreatedForAllBoards) | |
| Verify that netclasses with correct DRC values are created for every board that has constraint sets. | |
Test suite for import of Cadence Allegro PCB .brd files.
Definition in file test_allegro_import.cpp.
|
static |
Definition at line 273 of file test_allegro_import.cpp.
References ARC, BEZIER, BOOST_TEST_MESSAGE(), KIGEOM::BoxToSegs(), CIRCLE, BOARD::Drawings(), Edge_Cuts, end, EDA_SHAPE::GetEnd(), EDA_SHAPE::GetPolyPoints(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), PCB_SHAPE_T, POLY, RECTANGLE, and SEGMENT.
Referenced by BOOST_AUTO_TEST_CASE().
| BOOST_AUTO_TEST_CASE | ( | AlgReferenceComponentPlacement | ) |
Cross-validate imported board component reference designators against .alg reference.
Definition at line 1425 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), getBoardsWithAlg(), ALG_REFERENCE_DATA::ParseAlgFile(), and ALG_REFERENCE_DATA::refDes.
| BOOST_AUTO_TEST_CASE | ( | AlgReferenceNetNames | ) |
Cross-validate imported board net names against .alg ASCII reference export.
Definition at line 1377 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), getBoardsWithAlg(), BOARD::GetNetInfo(), ALG_REFERENCE_DATA::netNames, and ALG_REFERENCE_DATA::ParseAlgFile().
| BOOST_AUTO_TEST_CASE | ( | AllTracksPositiveWidth | ) |
Verify that all tracks and arcs have positive width across all boards.
Definition at line 1484 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), PCB_ARC_T, PCB_TRACE_T, and BOARD::Tracks().
| BOOST_AUTO_TEST_CASE | ( | ArcConnectivity | ) |
Verify that arc start points connect to adjacent track endpoints.
This checks that arc orientation/winding is correct.
Definition at line 999 of file test_allegro_import.cpp.
References boards, BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), PCB_TRACK::GetEnd(), BOARD_CONNECTED_ITEM::GetNetCode(), PCB_TRACK::GetStart(), pad, PCB_ARC_T, PCB_TRACE_T, PCB_VIA_T, BOARD::Tracks(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | BeagleBone_DrillSlotOrientation | ) |
Verify that oblong drill slots on BeagleBone connectors align with their copper pad orientation.
P6 pads 20/21, P3 pad 6, and P1 pads 1-3 have vertical oblong pads that require vertical slots. Previously the slot dimensions were imported as (primary, secondary) instead of matching the pad aspect ratio, producing horizontal slots on vertical pads.
Definition at line 2630 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), F_Cu, BOARD::Footprints(), pad, FOOTPRINT::Pads(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | BeagleBone_OutermostZoneNets | ) |
Verify that the outermost (largest area) zone on each copper layer of BeagleBone Black is assigned the GND_EARTH net.
Allegro stores these as BOUNDARY shapes with net pointers resolved through the Ptr7 -> 0x2C TABLE -> 0x37 -> 0x1B NET chain.
Definition at line 629 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOX2< Vec >::GetHeight(), BOARD::GetLayerID(), BOARD_CONNECTED_ITEM::GetNetname(), BOX2< Vec >::GetWidth(), UNDEFINED_LAYER, and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | BeagleBone_Teardrops | ) |
Verify that Allegro dynamic copper shapes (m_Unknown2 bit 12) are imported as teardrop zones, and that the pads/vias anchoring those teardrops have teardrops enabled.
Definition at line 2747 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), pad, PCB_VIA_T, BOARD::Tracks(), and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | BeagleBone_ZoneFills | ) |
Verify that zones on BeagleBone have fill polygons imported from Allegro's computed copper.
The GND_EARTH zones should have non-empty fill polygon data.
Definition at line 2709 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | BoardOutline | ) |
Test that board outline is imported correctly.
Definition at line 361 of file test_allegro_import.cpp.
References AssertOutlineValid(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and CountOutlineElements().
| BOOST_AUTO_TEST_CASE | ( | CopperText | ) |
Test that copper_text.brd imports the "TESTING" text on F.Cu.
Definition at line 516 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), F_Cu, IsCopperLayer(), PCB_TEXT_T, and text.
| BOOST_AUTO_TEST_CASE | ( | FootprintLayerPlacement | ) |
Verify that footprints are placed on the correct layer.
Tests that bottom-layer components are imported with correct layer assignment. BeagleBone Black C78 is known to be a bottom-layer component.
Definition at line 945 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), B_Cu, BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), F_Cu, BOARD::Footprints(), FOOTPRINT::GetLayer(), BOARD::GetLayerName(), and FOOTPRINT::IsFlipped().
| BOOST_AUTO_TEST_CASE | ( | FootprintOrientation | ) |
Verify that footprint J1 in BeagleBone_Black_RevC imports at 180 degrees orientation.
This catches a bug where EDA_ANGLE was constructed without DEGREES_T, causing the rotation value to be misinterpreted.
Definition at line 2412 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), EDA_ANGLE::AsDegrees(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), and FOOTPRINT::GetOrientation().
| BOOST_AUTO_TEST_CASE | ( | FootprintRefDes | ) |
Test that footprints have valid reference designators.
Definition at line 78 of file test_allegro_import.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_REQUIRE(), and BOOST_TEST_MESSAGE().
| BOOST_AUTO_TEST_CASE | ( | LegacyNetclassFlags | ) |
Verify that the importer sets the legacy netclass and design settings flags so that netclasses survive the SetProject() call during UI import (which replaces m_NetSettings with the project's version unless these flags are set).
Definition at line 2843 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), PCB_IO_ALLEGRO::LoadBoard(), reporter, and IO_BASE::SetReporter().
| BOOST_AUTO_TEST_CASE | ( | NetclassesCreatedForAllBoards | ) |
Verify that netclasses with correct DRC values are created for every board that has constraint sets.
Tests the full matrix of boards and their expected netclass counts.
Definition at line 2868 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_MESSAGE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::m_NetSettings, and name.
| BOOST_AUTO_TEST_CASE | ( | OutlineBoundingBox | ) |
Compare board bounding box from binary import against .alg outline coordinates.
The .alg coordinates are in mils; we convert to nanometers for comparison.
Definition at line 1728 of file test_allegro_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), ALG_OUTLINE_DATA::designOutlineCount, BOARD::Drawings(), Edge_Cuts, getBoardsWithAlg(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), ALG_OUTLINE_DATA::maxX, ALG_OUTLINE_DATA::maxY, BOX2< Vec >::Merge(), ALG_OUTLINE_DATA::minX, ALG_OUTLINE_DATA::minY, ALG_OUTLINE_DATA::ParseAlgOutlines(), and PCB_SHAPE_T.
| BOOST_AUTO_TEST_CASE | ( | OutlineEndpoints | ) |
For boards with line-only outlines, verify each segment endpoint matches the .alg reference within tolerance.
Allegro's Y axis is inverted relative to KiCad, so we compare absolute coordinate differences.
Definition at line 1815 of file test_allegro_import.cpp.
References std::abs(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), ALG_OUTLINE_DATA::designOutlineCount, ALG_OUTLINE_DATA::designOutlineSegments, BOARD::Drawings(), Edge_Cuts, end, getBoardsWithAlg(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), ALG_OUTLINE_DATA::LINE, ALG_OUTLINE_DATA::ParseAlgOutlines(), PCB_SHAPE_T, ALG_OUTLINE_DATA::RECTANGLE, SEGMENT, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | OutlineSegmentCount | ) |
Compare board outline segment count from binary import against .alg reference.
Uses DESIGN_OUTLINE records since those are what the binary importer targets.
Definition at line 1682 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), ALG_OUTLINE_DATA::designOutlineCount, BOARD::Drawings(), Edge_Cuts, ALG_OUTLINE_DATA::expectedEdgeCutsSegments(), getBoardsWithAlg(), ALG_OUTLINE_DATA::outlineCount, ALG_OUTLINE_DATA::ParseAlgOutlines(), and PCB_SHAPE_T.
| BOOST_AUTO_TEST_CASE | ( | PadContainedInFabOutline | ) |
Verify that footprint pads are contained within their F.Fab outline bounding box.
This catches coordinate-space bugs where 0x0D pad positions (footprint-local) are incorrectly treated as board-absolute, causing pads to be placed far from their footprint's fabrication outline.
Definition at line 2231 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), B_Fab, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOX2< Vec >::Contains(), F_Fab, BOARD::Footprints(), BOX2< Vec >::Inflate(), BOX2< Vec >::Merge(), pad, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadDrillConsistency | ) |
Verify PTH pads have nonzero drill and SMD pads have zero drill across all boards.
Definition at line 1977 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), pad, PTH, and SMD.
| BOOST_AUTO_TEST_CASE | ( | PadNumbers | ) |
Test that pad numbers are set correctly.
Definition at line 228 of file test_allegro_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and pad.
| BOOST_AUTO_TEST_CASE | ( | PadOrientationP6P10 | ) |
Verify pad orientation on footprints P6 and P10.
The binary format stores pad rotation in footprint-local space via 0x0D. An earlier bug double-subtracted footprint rotation, causing pads to appear rotated 90 degrees from their correct orientation.
Definition at line 2311 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOARD::Footprints(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), and pad.
| BOOST_AUTO_TEST_CASE | ( | PadsInsideOutline | ) |
Test that all pads are inside the board outline.
Definition at line 382 of file test_allegro_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), BOX2< Vec >::Contains(), Edge_Cuts, BOX2< Vec >::Inflate(), BOX2< Vec >::Merge(), pad, PCB_SHAPE_T, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadSizes | ) |
Test that pads have valid sizes and are not degenerate.
Definition at line 107 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), F_Cu, pad, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PadSizesPositive | ) |
Verify that all pads have positive sizes (no negative dimensions).
Definition at line 684 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), F_Cu, BOARD::Footprints(), pad, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PreV16FileRejection | ) |
Verify that pre-v16 Allegro files are rejected with an informative error message rather than an opaque "Unknown Allegro file version" error.
Definition at line 456 of file test_allegro_import.cpp.
References IO_ERROR::What().
| BOOST_AUTO_TEST_CASE | ( | PreV172_NoTeardrops | ) |
Verify that pre-V172 boards (which lack the m_Unknown2 discriminator field) have no teardrop zones and no pads/vias with teardrops enabled.
Definition at line 2806 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOARD::Footprints(), pad, and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | QuadPackagePadRotation | ) |
Verify that pads on quad flat packages (QFN/QFP) have proper rotation.
Pads on the sides should be rotated 90° from each other.
Definition at line 829 of file test_allegro_import.cpp.
References EDA_ANGLE::AsDegrees(), boards, BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::Merge(), EDA_ANGLE::Normalize(), and pad.
| BOOST_AUTO_TEST_CASE | ( | RectsZoneVsCopperPolygon | ) |
Test that rects.brd imports one zone fill (left rectangle) and one standalone copper polygon with a net (right rectangle).
Verifies that BOUNDARY shapes with unnamed nets correctly resolve their net from overlapping fills.
Definition at line 475 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), ZONE::GetFirstLayer(), PCB_SHAPE::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), EDA_SHAPE::GetShape(), IsCopperLayer(), ZONE::IsFilled(), PCB_SHAPE_T, and POLY.
| BOOST_AUTO_TEST_CASE | ( | SlotHoles | ) |
Verify that oblong (slot) drill holes are imported with the correct shape and dimensions.
The builder must set PAD_DRILL_SHAPE::OBLONG when width != height.
BeagleBone Black has 7 slot holes in total: 2x 50x15 mil, 2x 95x40 mil, 1x 120x40 mil @90, 1x 120x40 mil, 1x 140x40 mil
Definition at line 2367 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), OBLONG, pad, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | SmdFootprintTechLayers | ) |
Verify that SMD-only footprint tech layers are consistent with the footprint side.
A front-side SMD footprint should have shapes/text only on front tech layers (F.SilkS, F.CrtYd, F.Fab, F.Mask, F.Paste). A bottom-side SMD footprint should have them only on back tech layers. Mixed-side items indicate the importer failed to canonicalize footprint children before flipping.
Definition at line 2549 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), boards, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), BOARD::GetLayerName(), IsBackLayer(), IsFrontLayer(), pad, PTH, and SMD.
| BOOST_AUTO_TEST_CASE | ( | SmdPadDetection | ) |
Verify that pads with no drill hole are properly marked as SMD.
If a pad has drill size of 0, it should have PAD_ATTRIB::SMD, not PTH.
Definition at line 772 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), BOARD::Footprints(), NPTH, pad, PTH, and SMD.
| BOOST_AUTO_TEST_CASE | ( | SmdPadLayerConsistency | ) |
Verify that SMD pad layer sets are consistent with their parent footprint side.
In KiCad, footprint definitions always use F.Cu for SMD pads. When a footprint is placed on the bottom of the board, Flip() moves pads to B.Cu. So after import:
Definition at line 2489 of file test_allegro_import.cpp.
References B_Cu, boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), LSET::Contains(), F_Cu, BOARD::Footprints(), pad, and SMD.
| BOOST_AUTO_TEST_CASE | ( | TrackWidths | ) |
Test that track widths are reasonable.
Definition at line 197 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and PCB_TRACE_T.
| BOOST_AUTO_TEST_CASE | ( | UIImportPath_NullBoard | ) |
Test that LoadBoard works when aAppendToMe is nullptr, which is the path used by the KiCad UI "Import Non-KiCad Board" flow.
The plugin must create and return a new BOARD.
Definition at line 2443 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardFile(), BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), PCB_IO_ALLEGRO::LoadBoard(), KI_TEST::PrintBoardStats(), reporter, IO_BASE::SetReporter(), IO_ERROR::What(), and IO_ERROR::what().
| BOOST_AUTO_TEST_CASE | ( | ViaDrillNotLargerThanSize | ) |
Verify that via drill sizes are not larger than via diameters.
This would indicate a parsing error in the padstack.
Definition at line 726 of file test_allegro_import.cpp.
References boards, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), F_Cu, PCB_VIA_T, BOARD::Tracks(), and via.
| BOOST_AUTO_TEST_CASE | ( | ViaSizes | ) |
Test that vias have valid sizes (not hardcoded fallback values).
Definition at line 154 of file test_allegro_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), F_Cu, PCB_VIA_T, and via.
| BOOST_AUTO_TEST_CASE | ( | ZoneBoundingBoxes | ) |
Cross-validate zone bounding box sizes between binary import and .alg reference.
Sorts zone areas per layer and verifies the size distributions match within tolerance.
Definition at line 2128 of file test_allegro_import.cpp.
References std::abs(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), getBoardsWithAlg(), BOX2< Vec >::GetHeight(), BOARD::GetLayerName(), BOX2< Vec >::GetWidth(), IsCopperLayer(), ALG_ZONE_POLYGON::layer, ALG_ZONE_POLYGON::maxX, ALG_ZONE_POLYGON::maxY, ALG_ZONE_POLYGON::minX, ALG_ZONE_POLYGON::minY, ALG_REFERENCE_DATA::ParseAlgFile(), ALG_REFERENCE_DATA::zonePolygons, and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | ZoneCountMatchesAlg | ) |
Cross-validate the number of copper zones against .alg ETCH SHAPE records.
Definition at line 2037 of file test_allegro_import.cpp.
References LSET::AllCuMask(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), getBoardsWithAlg(), ALG_REFERENCE_DATA::ParseAlgFile(), ALG_REFERENCE_DATA::zonePolygons, and BOARD::Zones().
| BOOST_AUTO_TEST_CASE | ( | ZoneLayerDistribution | ) |
Cross-validate how many zones appear on each copper layer.
Definition at line 2075 of file test_allegro_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), getBoardsWithAlg(), BOARD::GetLayerName(), IsCopperLayer(), ALG_ZONE_POLYGON::layer, ALG_REFERENCE_DATA::ParseAlgFile(), ALG_REFERENCE_DATA::zonePolygons, and BOARD::Zones().
|
static |
Definition at line 259 of file test_allegro_import.cpp.
References BOARD::Drawings(), Edge_Cuts, and PCB_SHAPE_T.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Get a list of all board files in the test data that have a corresponding .alg reference file.
This allows us to automatically run cross-validation tests on all boards with reference data.
Definition at line 1339 of file test_allegro_import.cpp.
References KI_TEST::AllegroBoardDataDir().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().