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

Test suite for IPC-2581 export validation. More...

#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/ipc2581/pcb_io_ipc2581.h>
#include <pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <board.h>
#include <board_design_settings.h>
#include <board_stackup_manager/board_stackup.h>
#include <footprint.h>
#include <pad.h>
#include <wx/dir.h>
#include <wx/file.h>
#include <wx/filename.h>
#include <wx/process.h>
#include <wx/txtstrm.h>
#include <fstream>
#include <sstream>

Go to the source code of this file.

Classes

struct  IPC2581_EXPORT_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (SurfaceFinishExport)
 Test that surface finish is exported correctly (Issue #22690)
 
 BOOST_AUTO_TEST_CASE (NoSurfaceFinishExport)
 Test that boards without surface finish don't generate coating layers.
 
 BOOST_AUTO_TEST_CASE (SchemaValidationVersionB)
 Validate IPC-2581B export against schema for multiple boards.
 
 BOOST_AUTO_TEST_CASE (SchemaValidationVersionC)
 Validate IPC-2581C export against schema for multiple boards.
 
 BOOST_AUTO_TEST_CASE (ComplexBoardExport)
 Test export of boards with complex features.
 
 BOOST_AUTO_TEST_CASE (SmdPadSolderMaskExport_Issue16658)
 Test that SMD pad solder mask openings are exported (Issue #16658)
 

Detailed Description

Test suite for IPC-2581 export validation.

Tests per GitLab issues:

  • #22690: Surface finish data not exported
  • #19912: OtherSideView may be incorrect for bottom components

Definition in file test_ipc2581_export.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( ComplexBoardExport )

Test export of boards with complex features.

Tests boards with zones, custom pads, and other features that may exercise edge cases in the IPC-2581 exporter.

Definition at line 415 of file test_ipc2581_export.cpp.

References BOOST_TEST_CONTEXT(), and LoadBoard().

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( NoSurfaceFinishExport )

Test that boards without surface finish don't generate coating layers.

Definition at line 285 of file test_ipc2581_export.cpp.

References BOOST_REQUIRE(), LoadBoard(), and BOARD_STACKUP::m_FinishType.

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( SchemaValidationVersionB )

Validate IPC-2581B export against schema for multiple boards.

This test exports each board in VALIDATION_TEST_BOARDS to IPC-2581B format and validates against the IPC-2581B1.xsd schema using xmllint (if available).

Definition at line 329 of file test_ipc2581_export.cpp.

References BOOST_TEST_CONTEXT(), and LoadBoard().

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( SchemaValidationVersionC )

Validate IPC-2581C export against schema for multiple boards.

This test exports each board in VALIDATION_TEST_BOARDS to IPC-2581C format and validates against the IPC-2581C.xsd schema using xmllint (if available).

Definition at line 372 of file test_ipc2581_export.cpp.

References BOOST_TEST_CONTEXT(), and LoadBoard().

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( SmdPadSolderMaskExport_Issue16658 )

Test that SMD pad solder mask openings are exported (Issue #16658)

This test verifies that SMD pads which have implicit solder mask openings (pads on copper layers that don't explicitly include F_Mask/B_Mask in their layer set) still get exported with solder mask features in the IPC-2581 output.

Definition at line 460 of file test_ipc2581_export.cpp.

References BOOST_REQUIRE(), F_Cu, F_Mask, LoadBoard(), pad, and SMD.

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( SurfaceFinishExport )

Test that surface finish is exported correctly (Issue #22690)

This test verifies that when a board has a surface finish defined:

  1. A Spec element with SurfaceFinish is created
  2. COATING_TOP and COATING_BOTTOM Layer elements are created with layerFunction="COATINGCOND"
  3. StackupLayer entries reference the surface finish Spec

Definition at line 237 of file test_ipc2581_export.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), LoadBoard(), and BOARD_STACKUP::m_FinishType.