20#include <boost/test/unit_test.hpp>
40static const char*
PARTIAL_PCB =
"net_chains/return_path_partial.kicad_pcb";
51 (condition "A.NetClass == 'Default'")
52 (constraint length (min 0mm) (max 200mm))
53 (constraint return_path (layer "B.Cu"))
60size_t runReturnPathDrc(
const char* aBoardFile,
const wxString& aChainName,
61 const wxString& aChainTag,
62 const std::string& aSubdir )
64 namespace fs = std::filesystem;
66 fs::path druPath = tmpDir.
Path() /
"ret.kicad_dru";
69 std::ofstream out( druPath );
75 board->BuildConnectivity();
83 auto drcEngine = std::make_shared<DRC_ENGINE>( board.get(), &bds );
84 wxFileName ruleFile( druPath.string() );
85 drcEngine->InitEngine( ruleFile );
96 size_t markerCount = 0;
98 drcEngine->SetViolationHandler(
99 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
108 fs::remove( druPath );
120 size_t n = runReturnPathDrc(
PARTIAL_PCB, wxS(
"/CHAIN_PARTIAL" ),
122 "kicad_drc_ret_partial" );
131 "kicad_drc_ret_full" );
General utilities for PCB file IO for QA programs.
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const std::filesystem::path & Path() const
Get the path to the temporary directory as a std::filesystem::path.
Handle the data for a net.
void SetNetChain(const wxString &aNetChain)
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
std::unique_ptr< BOARD > LoadBoard(const wxString &aFileName, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
Load information from some input file format that this PCB_IO implementation knows about into new BOA...
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_NET_CHAIN_RETURN_PATH_BREAK
@ DRCE_LIB_FOOTPRINT_MISMATCH
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
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