KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_odb_drill_tools.cpp File Reference
#include <filesystem>
#include <fstream>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <qa_utils/file_utils.h>
#include <pcbnew_utils/board_file_utils.h>
#include <boost/test/unit_test.hpp>
#include <board.h>
#include <pad.h>
#include <pcbnew/pcb_io/odbpp/pcb_io_odbpp.h>
#include <settings/settings_manager.h>
#include <core/utf8.h>

Go to the source code of this file.

Classes

struct  ODB_EXPORT_STATE_GUARD
 Save and restore the static ODB++ exporter formatting state. More...
 
struct  ODB_TOOL_RECORD
 One TOOLS record from an ODB++ drill layer "tools" file. More...
 

Functions

static std::vector< ODB_TOOL_RECORDparseOdbTools (const fs::path &aToolsFile)
 Parse the TOOLS records out of an ODB++ "tools" file.
 
 BOOST_AUTO_TEST_CASE (OdbNonPlatedDrillTools)
 Test that the ODB++ drill "tools" file describes the board's non-plated holes.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( OdbNonPlatedDrillTools )

Test that the ODB++ drill "tools" file describes the board's non-plated holes.

The fixture carries a Tag-Connect TC2030 footprint whose non-plated holes come in three distinct sizes, two of them repeated, which is what makes both halves of the contract observable: sizes are written in the file's own units, and each drill bit gets exactly one tool number.

Definition at line 133 of file test_odb_drill_tools.cpp.

References BOOST_CHECK_EQUAL(), BOOST_CHECK_EQUAL_COLLECTIONS(), BOOST_REQUIRE(), KI_TEST::GetPcbnewTestDataDir(), NPTH, pad, parseOdbTools(), KI_TEST::SCOPED_TEMP_DIR::Path(), pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), PCB_IO_ODBPP::SaveBoard(), and tools.

◆ parseOdbTools()

static std::vector< ODB_TOOL_RECORD > parseOdbTools ( const fs::path & aToolsFile)
static

Parse the TOOLS records out of an ODB++ "tools" file.

The format is a flat sequence of "TOOLS {" blocks of KEY=VALUE lines. Only the keys the drill tool table is asserted on are read; the file's leading UNITS/THICKNESS/USER_PARAMS lines share none of those names, so they fall through untouched.

Definition at line 89 of file test_odb_drill_tools.cpp.

References tools.

Referenced by BOOST_AUTO_TEST_CASE().