|
KiCad PCB EDA Suite
|
#include <pcbnew_utils/board_test_utils.h>#include <pcbnew_utils/board_file_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcb_io/pads/pcb_io_pads_binary.h>#include <pcb_io/pads/pcb_io_pads.h>#include <layer_ids.h>#include <padstack.h>#include <board.h>#include <pcb_text.h>#include <pcb_shape.h>#include <pcb_field.h>#include <pad.h>#include <pcb_track.h>#include <footprint.h>#include <zone.h>#include <board_design_settings.h>#include <set>Go to the source code of this file.
Classes | |
| struct | PADS_BINARY_BOARD_INFO |
Macros | |
| #define | BINARY_LOAD_TEST(name, idx) |
| #define | FOOTPRINT_COUNT_TEST(name, idx) |
| #define | NET_COUNT_TEST(name, idx) |
| #define | TRACK_COUNT_TEST(name, idx) |
| #define | STRUCTURAL_INTEGRITY_TEST(name, idx) |
Functions | |
| static wxString | GetBinaryPath (const PADS_BINARY_BOARD_INFO &aBoard) |
| static wxString | GetAscPath (const PADS_BINARY_BOARD_INFO &aBoard) |
| static std::unique_ptr< BOARD > | LoadBinary (const PADS_BINARY_BOARD_INFO &aBoard) |
| Load a binary .pcb file. | |
| static std::unique_ptr< BOARD > | LoadAsc (const PADS_BINARY_BOARD_INFO &aBoard) |
| static int | CountEdgeCutsShapes (const BOARD *aBoard) |
| static void | CheckCountWithTolerance (const std::string &aLabel, size_t aBinaryCount, size_t aAscCount, bool aDifferentRevision) |
| Compare counts with tolerance for binary/ASC differences. | |
| static void | RunStructuralChecks (const PADS_BINARY_BOARD_INFO &aBoard, const BOARD *aBinaryBoard) |
| Structural integrity checks. | |
| BOOST_AUTO_TEST_CASE (BinaryFileDetection) | |
| BOOST_AUTO_TEST_CASE (AsciiFileRejection) | |
| BOOST_AUTO_TEST_CASE (BoardOutline_LCORE_4) | |
| BOOST_AUTO_TEST_CASE (BoardOutline_LCORE_2) | |
| BOOST_AUTO_TEST_CASE (BoardOutline_OtherVersions) | |
Variables | |
| static const PADS_BINARY_BOARD_INFO | PADS_BINARY_BOARDS [] |
| #define BINARY_LOAD_TEST | ( | name, | |
| idx ) |
Definition at line 276 of file test_pads_binary_import.cpp.
| #define FOOTPRINT_COUNT_TEST | ( | name, | |
| idx ) |
Definition at line 295 of file test_pads_binary_import.cpp.
| #define NET_COUNT_TEST | ( | name, | |
| idx ) |
Definition at line 320 of file test_pads_binary_import.cpp.
| #define STRUCTURAL_INTEGRITY_TEST | ( | name, | |
| idx ) |
Definition at line 410 of file test_pads_binary_import.cpp.
| #define TRACK_COUNT_TEST | ( | name, | |
| idx ) |
Definition at line 344 of file test_pads_binary_import.cpp.
| BOOST_AUTO_TEST_CASE | ( | AsciiFileRejection | ) |
Definition at line 262 of file test_pads_binary_import.cpp.
References PCB_IO_PADS_BINARY::CanReadBoard(), GetAscPath(), and PADS_BINARY_BOARDS.
| BOOST_AUTO_TEST_CASE | ( | BinaryFileDetection | ) |
Definition at line 244 of file test_pads_binary_import.cpp.
References BOOST_AUTO_TEST_CASE(), PCB_IO_PADS::CanReadBoard(), PCB_IO_PADS_BINARY::CanReadBoard(), GetBinaryPath(), and PADS_BINARY_BOARDS.
| BOOST_AUTO_TEST_CASE | ( | BoardOutline_LCORE_2 | ) |
Definition at line 380 of file test_pads_binary_import.cpp.
References CountEdgeCutsShapes(), LoadBinary(), and PADS_BINARY_BOARDS.
| BOOST_AUTO_TEST_CASE | ( | BoardOutline_LCORE_4 | ) |
Definition at line 368 of file test_pads_binary_import.cpp.
References BOOST_AUTO_TEST_CASE(), CountEdgeCutsShapes(), LoadBinary(), and PADS_BINARY_BOARDS.
| BOOST_AUTO_TEST_CASE | ( | BoardOutline_OtherVersions | ) |
Definition at line 392 of file test_pads_binary_import.cpp.
References CountEdgeCutsShapes(), LoadBinary(), and PADS_BINARY_BOARDS.
|
static |
Compare counts with tolerance for binary/ASC differences.
Different-revision files get BOOST_WARN only. Same-revision files allow up to 5% or off-by-2, with exact matches reported via BOOST_WARN.
Definition at line 152 of file test_pads_binary_import.cpp.
|
static |
Definition at line 130 of file test_pads_binary_import.cpp.
References BOARD::Drawings(), and Edge_Cuts.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 72 of file test_pads_binary_import.cpp.
References PADS_BINARY_BOARD_INFO::ascFile, PADS_BINARY_BOARD_INFO::dir, and KI_TEST::GetPcbnewTestDataDir().
Referenced by BOOST_AUTO_TEST_CASE(), and LoadAsc().
|
static |
Definition at line 65 of file test_pads_binary_import.cpp.
References PADS_BINARY_BOARD_INFO::binaryFile, PADS_BINARY_BOARD_INFO::dir, and KI_TEST::GetPcbnewTestDataDir().
Referenced by BOOST_AUTO_TEST_CASE(), and LoadBinary().
|
static |
Definition at line 108 of file test_pads_binary_import.cpp.
References PADS_BINARY_BOARD_INFO::dir, GetAscPath(), and PCB_IO_PADS::LoadBoard().
|
static |
Load a binary .pcb file.
Returns nullptr and issues a warning if the load throws, since the parser is under active development. Callers must null-check.
Definition at line 82 of file test_pads_binary_import.cpp.
References PCB_IO_PADS_BINARY::CanReadBoard(), PADS_BINARY_BOARD_INFO::dir, GetBinaryPath(), and PCB_IO_PADS_BINARY::LoadBoard().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Structural integrity checks.
Uses BOOST_CHECK for invariants and BOOST_WARN for in-progress features.
Definition at line 189 of file test_pads_binary_import.cpp.
References PADSTACK::ALL_LAYERS, PADS_BINARY_BOARD_INFO::dir, BOARD::Footprints(), IsCopperLayer(), pad, PCB_ARC_T, PCB_TRACE_T, THROUGH, BOARD::Tracks(), and via.
|
static |
Definition at line 53 of file test_pads_binary_import.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().