44 std::filesystem::path tempPath = std::filesystem::temp_directory_path() /
"pad_tenting_test.kicad_pcb";
45 std::stringstream buf;
50 std::ifstream ifs( tempPath );
54 std::filesystem::remove( tempPath );
68 auto fp = std::make_unique<FOOTPRINT>( &board );
71 auto*
pad =
new PAD( fp.get() );
78 pad->SetNumber( wxT(
"1" ) );
81 BOOST_CHECK( !
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
82 BOOST_CHECK( !
pad->Padstack().BackOuterLayers().has_solder_mask.has_value() );
85 board.
Add( fp.release() );
89 BOOST_CHECK_MESSAGE( output.find(
"(tenting" ) == std::string::npos
90 || output.find(
"(tenting" ) < output.find(
"(footprint" ),
91 "PTH pad with default tenting should not have a (tenting) block. "
92 "Board-level tenting in setup section is expected." );
104 auto fp = std::make_unique<FOOTPRINT>( &board );
105 fp->SetPosition(
VECTOR2I( 0, 0 ) );
107 auto*
pad =
new PAD( fp.get() );
114 pad->SetNumber( wxT(
"1" ) );
117 pad->Padstack().FrontOuterLayers().has_solder_mask =
true;
119 BOOST_CHECK(
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
122 board.
Add( fp.release() );
126 size_t fpStart = output.find(
"(footprint" );
129 size_t tentingPos = output.find(
"(tenting", fpStart );
130 BOOST_CHECK_MESSAGE( tentingPos != std::string::npos,
131 "PTH pad with explicit tenting should have a (tenting) block" );
143 auto fp = std::make_unique<FOOTPRINT>( &board );
144 fp->SetPosition(
VECTOR2I( 0, 0 ) );
146 auto*
pad =
new PAD( fp.get() );
153 pad->SetNumber( wxT(
"" ) );
156 BOOST_CHECK( !
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
157 BOOST_CHECK( !
pad->Padstack().BackOuterLayers().has_solder_mask.has_value() );
160 board.
Add( fp.release() );
164 size_t fpStart = output.find(
"(footprint" );
167 size_t tentingPos = output.find(
"(tenting", fpStart );
168 BOOST_CHECK_MESSAGE( tentingPos == std::string::npos,
169 "NPTH pad with default tenting should not have a (tenting) block" );
187 BOOST_CHECK( !
via->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
188 BOOST_CHECK( !
via->Padstack().BackOuterLayers().has_solder_mask.has_value() );
194 size_t viaStart = output.find(
"(via" );
197 size_t tentingPos = output.find(
"(tenting", viaStart );
198 BOOST_CHECK_MESSAGE( tentingPos == std::string::npos,
199 "Via with default tenting should not have a (tenting) block" );
217 via->Padstack().FrontOuterLayers().has_solder_mask =
false;
218 via->Padstack().BackOuterLayers().has_solder_mask =
false;
224 size_t viaStart = output.find(
"(via" );
227 size_t tentingPos = output.find(
"(tenting", viaStart );
228 BOOST_CHECK_MESSAGE( tentingPos != std::string::npos,
229 "Via with explicit tenting should have a (tenting) block" );
constexpr EDA_IU_SCALE pcbIUScale
General utilities for PCB file IO for QA programs.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
static LSET PTHMask()
layer set for a through hole pad
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
void DumpBoardToFile(BOARD &board, const std::string &aFilename)
Utility function to simply write a Board out to a file.
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ PTH
Plated through hole pad.
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static std::string SaveBoardToString(BOARD &aBoard)
BOOST_AUTO_TEST_CASE(DefaultTentingNotSerialized)
Pads with no explicit tenting set should not have a (tenting ...) block in the output.
VECTOR2< int32_t > VECTOR2I