20#include <boost/test/unit_test.hpp>
41 (generator_version "9.99")
48 (net 1 "/CHAIN_PARTIAL")
50 (gr_line (start -5 -5) (end 35 -5) (layer "Edge.Cuts") (width 0.05))
51 (gr_line (start 35 -5) (end 35 5) (layer "Edge.Cuts") (width 0.05))
52 (gr_line (start 35 5) (end -5 5) (layer "Edge.Cuts") (width 0.05))
53 (gr_line (start -5 5) (end -5 -5) (layer "Edge.Cuts") (width 0.05))
54 (segment (start 0 0) (end 15 0) (width 0.2) (layer "F.Cu") (net 1))
55 (segment (start 15 0) (end 30 0) (width 0.2) (layer "F.Cu") (net 1))
56 (zone (net 2) (net_name "/GND") (layer "B.Cu") (name "gnd_left") (hatch edge 0.508)
57 (connect_pads (clearance 0))
58 (min_thickness 0.254) (filled_areas_thickness no)
59 (fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
61 (pts (xy -1 -1) (xy 15 -1) (xy 15 1) (xy -1 1))
75 (generator_version "9.99")
84 (gr_line (start -5 -5) (end 55 -5) (layer "Edge.Cuts") (width 0.05))
85 (gr_line (start 55 -5) (end 55 5) (layer "Edge.Cuts") (width 0.05))
86 (gr_line (start 55 5) (end -5 5) (layer "Edge.Cuts") (width 0.05))
87 (gr_line (start -5 5) (end -5 -5) (layer "Edge.Cuts") (width 0.05))
88 (segment (start 0 0) (end 30 0) (width 0.2) (layer "F.Cu") (net 1))
89 (zone (net 2) (net_name "/GND") (layer "B.Cu") (name "gnd_far") (hatch edge 0.508)
90 (connect_pads (clearance 0))
91 (min_thickness 0.254) (filled_areas_thickness no)
92 (fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
94 (pts (xy 40 -1) (xy 50 -1) (xy 50 1) (xy 40 1))
103 (condition "A.NetClass == 'Default'")
104 (constraint length (min 0mm) (max 200mm))
105 (constraint return_path (layer "B.Cu"))
112size_t runReturnPathDrc(
const char* aPcb,
const wxString& aChainName,
113 const wxString& aChainTag,
114 const std::string& aSubdir )
116 namespace fs = std::filesystem;
117 fs::path tmpDir = fs::temp_directory_path() / aSubdir;
118 fs::create_directories( tmpDir );
119 fs::path pcbPath = tmpDir /
"ret.kicad_pcb";
120 fs::path druPath = tmpDir /
"ret.kicad_dru";
123 std::ofstream out( pcbPath );
128 std::ofstream out( druPath );
133 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
134 plugin.
LoadBoard( pcbPath.string(), board.get() );
135 board->BuildConnectivity();
143 auto drcEngine = std::make_shared<DRC_ENGINE>( board.get(), &bds );
144 wxFileName ruleFile( druPath.string() );
145 drcEngine->InitEngine( ruleFile );
156 size_t markerCount = 0;
158 drcEngine->SetViolationHandler(
159 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
168 fs::remove( pcbPath );
169 fs::remove( druPath );
181 size_t n = runReturnPathDrc(
PARTIAL_PCB, wxS(
"/CHAIN_PARTIAL" ),
183 "kicad_drc_ret_partial" );
192 "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