KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_fabmaster_import.cpp File Reference

Test suite for import of Fabmaster PCB files. More...

Go to the source code of this file.

Classes

struct  FABMASTER_IMPORT_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (EmptyRefdesInPins)
 Test that footprints with pads are properly imported when the REFDES column is empty in the PIN section.
 
 BOOST_AUTO_TEST_CASE (StaticShapesPreserved)
 Test that static shapes (zones with net but no matching outline) are preserved.
 
static const PADfindPadByNumber (const FOOTPRINT *aFp, const wxString &aNumber)
 Helper to find a pad by its number within a footprint.
 
 BOOST_AUTO_TEST_CASE (PadStackDifferentLayers)
 Test that pad-stacks with different shapes on front and back copper layers are imported using FRONT_INNER_BACK padstack mode.
 
 BOOST_AUTO_TEST_CASE (PadStackSameLayers)
 Test that pad-stacks with the same shape on all layers remain in NORMAL mode.
 
 BOOST_AUTO_TEST_CASE (PadStackSmdPad)
 Test SMD pads (top-only, no drill) are imported correctly.
 
 BOOST_AUTO_TEST_CASE (AreaClassesImportedAsRuleAreas)
 Test that Allegro area "shapes" (keepouts, keepins and constraint regions) are imported as KiCad rule areas rather than unconnected copper fill zones.
 

Detailed Description

Test suite for import of Fabmaster PCB files.

Definition in file test_fabmaster_import.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( AreaClassesImportedAsRuleAreas )

Test that Allegro area "shapes" (keepouts, keepins and constraint regions) are imported as KiCad rule areas rather than unconnected copper fill zones.

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/7732

In Allegro these areas carry no net. Importing them as copper fill zones silently creates shorts. Each Allegro area class maps to a distinct rule-area restriction: ROUTE KEEPOUT -> no tracks, vias, pads or zone fills VIA KEEPOUT -> no vias PACKAGE KEEPOUT -> no footprints ROUTE/PACKAGE KEEPIN and CONSTRAINT REGION -> named marker with no restrictions (KiCad has no equivalent, so the shape is preserved without producing copper)

The test file mirrors the reporter's board and contains 5 route keepouts, 5 via keepouts, 3 package keepouts, 1 route keepin, 1 package keepin and 8 constraint regions.

Definition at line 263 of file test_fabmaster_import.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), and KI_TEST::GetPcbnewTestDataDir().

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( EmptyRefdesInPins )

Test that footprints with pads are properly imported when the REFDES column is empty in the PIN section.

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/7955

When a Fabmaster file is exported from a board with only components and no netlist, the REFDES column in the PIN section is empty. The importer should fall back to using SYM_NAME to match pins with their footprints.

Definition at line 58 of file test_fabmaster_import.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), and KI_TEST::GetPcbnewTestDataDir().

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( PadStackDifferentLayers )

Test that pad-stacks with different shapes on front and back copper layers are imported using FRONT_INNER_BACK padstack mode.

The test file contains: DIFF_PAD - CIRCLE on TOP (2.0mm), RECTANGLE on BOTTOM (1.5x3.0mm) with drill SAME_PAD - RECTANGLE on both TOP and BOTTOM (1.0x2.0mm) with drill SMD_DIFF - OVAL on TOP only (0.8x1.6mm), SMD pad

Definition at line 149 of file test_fabmaster_import.cpp.

References B_Cu, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), CIRCLE, F_Cu, findPadByNumber(), PADSTACK::FRONT_INNER_BACK, PAD::GetAttribute(), PAD::GetDrillSizeX(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), PAD::GetSize(), PADSTACK::Mode(), FOOTPRINT::Pads(), PAD::Padstack(), PTH, RECTANGLE, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( PadStackSameLayers )

Test that pad-stacks with the same shape on all layers remain in NORMAL mode.

Definition at line 195 of file test_fabmaster_import.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), F_Cu, findPadByNumber(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), PADSTACK::Mode(), PADSTACK::NORMAL, PAD::Padstack(), and RECTANGLE.

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( PadStackSmdPad )

Test SMD pads (top-only, no drill) are imported correctly.

Definition at line 223 of file test_fabmaster_import.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), F_Cu, findPadByNumber(), PAD::GetAttribute(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), OVAL, and SMD.

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( StaticShapesPreserved )

Test that static shapes (zones with net but no matching outline) are preserved.

This is a regression test for https://gitlab.com/kicad/code/kicad/-/issues/7753

In Allegro, static shapes are copper areas that don't void around other nets. They appear in Fabmaster as filled areas (with net) but without a corresponding outline (which would have no net). The importer must preserve these as solid filled zones.

The test file contains static shapes on nets like "DO" and "VMBATT3-" that are zero-width closed polygons with net assignments but no matching outline.

Definition at line 97 of file test_fabmaster_import.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), and KI_TEST::GetPcbnewTestDataDir().

◆ findPadByNumber()

static const PAD * findPadByNumber ( const FOOTPRINT * aFp,
const wxString & aNumber )
static

Helper to find a pad by its number within a footprint.

Definition at line 128 of file test_fabmaster_import.cpp.

References pad, and FOOTPRINT::Pads().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().