21#include <boost/test/unit_test.hpp>
42 (generator_version "9.99")
49 (net 1 "/CHAIN_PARTIAL")
51 (gr_line (start -5 -5) (end 35 -5) (layer "Edge.Cuts") (width 0.05))
52 (gr_line (start 35 -5) (end 35 5) (layer "Edge.Cuts") (width 0.05))
53 (gr_line (start 35 5) (end -5 5) (layer "Edge.Cuts") (width 0.05))
54 (gr_line (start -5 5) (end -5 -5) (layer "Edge.Cuts") (width 0.05))
55 (segment (start 0 0) (end 15 0) (width 0.2) (layer "F.Cu") (net 1))
56 (segment (start 15 0) (end 30 0) (width 0.2) (layer "F.Cu") (net 1))
57 (zone (net 2) (net_name "/GND") (layer "B.Cu") (name "gnd_left") (hatch edge 0.508)
58 (connect_pads (clearance 0))
59 (min_thickness 0.254) (filled_areas_thickness no)
60 (fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
62 (pts (xy -1 -1) (xy 15 -1) (xy 15 1) (xy -1 1))
76 (generator_version "9.99")
85 (gr_line (start -5 -5) (end 55 -5) (layer "Edge.Cuts") (width 0.05))
86 (gr_line (start 55 -5) (end 55 5) (layer "Edge.Cuts") (width 0.05))
87 (gr_line (start 55 5) (end -5 5) (layer "Edge.Cuts") (width 0.05))
88 (gr_line (start -5 5) (end -5 -5) (layer "Edge.Cuts") (width 0.05))
89 (segment (start 0 0) (end 30 0) (width 0.2) (layer "F.Cu") (net 1))
90 (zone (net 2) (net_name "/GND") (layer "B.Cu") (name "gnd_far") (hatch edge 0.508)
91 (connect_pads (clearance 0))
92 (min_thickness 0.254) (filled_areas_thickness no)
93 (fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
95 (pts (xy 40 -1) (xy 50 -1) (xy 50 1) (xy 40 1))
104 (condition "A.NetClass == 'Default'")
105 (constraint length (min 0mm) (max 200mm))
106 (constraint return_path (layer "B.Cu"))
113size_t runReturnPathDrc(
const char* aPcb,
const wxString& aChainName,
114 const wxString& aChainTag,
115 const std::string& aSubdir )
117 namespace fs = std::filesystem;
118 fs::path tmpDir = fs::temp_directory_path() / aSubdir;
119 fs::create_directories( tmpDir );
120 fs::path pcbPath = tmpDir /
"ret.kicad_pcb";
121 fs::path druPath = tmpDir /
"ret.kicad_dru";
124 std::ofstream out( pcbPath );
129 std::ofstream out( druPath );
134 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
135 plugin.
LoadBoard( pcbPath.string(), board.get() );
136 board->BuildConnectivity();
144 auto drcEngine = std::make_shared<DRC_ENGINE>( board.get(), &bds );
145 wxFileName ruleFile( druPath.string() );
146 drcEngine->InitEngine( ruleFile );
157 size_t markerCount = 0;
159 drcEngine->SetViolationHandler(
160 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
169 fs::remove( pcbPath );
170 fs::remove( druPath );
182 size_t n = runReturnPathDrc(
PARTIAL_PCB, wxS(
"/CHAIN_PARTIAL" ),
184 "kicad_drc_ret_partial" );
193 "kicad_drc_ret_full" );
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
Handle the data for a net.
void SetNetChain(const wxString &aNetChain)
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_NET_CHAIN_RETURN_PATH_BREAK
@ DRCE_LIB_FOOTPRINT_MISMATCH
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
static const char * DRU_TEXT
static const char * FULLY_UNSHADOWED_PCB
static const char * PARTIAL_PCB
BOOST_AUTO_TEST_CASE(PartiallyShadowedTrunkReportsOneMarker)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I