40 std::filesystem::path tempPath = std::filesystem::temp_directory_path() /
"pad_tenting_test.kicad_pcb";
41 std::stringstream buf;
46 std::ifstream ifs( tempPath );
50 std::filesystem::remove( tempPath );
64 auto fp = std::make_unique<FOOTPRINT>( &board );
67 auto*
pad =
new PAD( fp.get() );
74 pad->SetNumber( wxT(
"1" ) );
77 BOOST_CHECK( !
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
78 BOOST_CHECK( !
pad->Padstack().BackOuterLayers().has_solder_mask.has_value() );
81 board.
Add( fp.release() );
86 ||
output.find(
"(tenting" ) <
output.find(
"(footprint" ),
87 "PTH pad with default tenting should not have a (tenting) block. "
88 "Board-level tenting in setup section is expected." );
100 auto fp = std::make_unique<FOOTPRINT>( &board );
101 fp->SetPosition(
VECTOR2I( 0, 0 ) );
103 auto*
pad =
new PAD( fp.get() );
110 pad->SetNumber( wxT(
"1" ) );
113 pad->Padstack().FrontOuterLayers().has_solder_mask =
true;
115 BOOST_CHECK(
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
118 board.
Add( fp.release() );
122 size_t fpStart =
output.find(
"(footprint" );
125 size_t tentingPos =
output.find(
"(tenting", fpStart );
127 "PTH pad with explicit tenting should have a (tenting) block" );
139 auto fp = std::make_unique<FOOTPRINT>( &board );
140 fp->SetPosition(
VECTOR2I( 0, 0 ) );
142 auto*
pad =
new PAD( fp.get() );
149 pad->SetNumber( wxT(
"" ) );
152 BOOST_CHECK( !
pad->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
153 BOOST_CHECK( !
pad->Padstack().BackOuterLayers().has_solder_mask.has_value() );
156 board.
Add( fp.release() );
160 size_t fpStart =
output.find(
"(footprint" );
163 size_t tentingPos =
output.find(
"(tenting", fpStart );
165 "NPTH pad with default tenting should not have a (tenting) block" );
183 BOOST_CHECK( !
via->Padstack().FrontOuterLayers().has_solder_mask.has_value() );
184 BOOST_CHECK( !
via->Padstack().BackOuterLayers().has_solder_mask.has_value() );
190 size_t viaStart =
output.find(
"(via" );
193 size_t tentingPos =
output.find(
"(tenting", viaStart );
195 "Via with default tenting should not have a (tenting) block" );
213 via->Padstack().FrontOuterLayers().has_solder_mask =
false;
214 via->Padstack().BackOuterLayers().has_solder_mask =
false;
220 size_t viaStart =
output.find(
"(via" );
223 size_t tentingPos =
output.find(
"(tenting", viaStart );
225 "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.
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
VECTOR2< int32_t > VECTOR2I