20#include <boost/test/unit_test.hpp>
39static const char*
PARTIAL_PCB =
"net_chains/return_path_partial.kicad_pcb";
50 (condition "A.NetClass == 'Default'")
51 (constraint length (min 0mm) (max 200mm))
52 (constraint return_path (layer "B.Cu"))
59size_t runReturnPathDrc(
const char* aBoardFile,
const wxString& aChainName,
60 const wxString& aChainTag,
61 const std::string& aSubdir )
63 namespace fs = std::filesystem;
64 fs::path tmpDir = fs::temp_directory_path() / aSubdir;
65 fs::create_directories( tmpDir );
66 fs::path druPath = tmpDir /
"ret.kicad_dru";
69 std::ofstream out( druPath );
74 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
76 board->BuildConnectivity();
84 auto drcEngine = std::make_shared<DRC_ENGINE>( board.get(), &bds );
85 wxFileName ruleFile( druPath.string() );
86 drcEngine->InitEngine( ruleFile );
97 size_t markerCount = 0;
99 drcEngine->SetViolationHandler(
100 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I&,
int,
109 fs::remove( druPath );
121 size_t n = runReturnPathDrc(
PARTIAL_PCB, wxS(
"/CHAIN_PARTIAL" ),
123 "kicad_drc_ret_partial" );
132 "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
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
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