42#include <wx/filename.h>
51 std::string
path(
const std::string& aName )
56 bool haveSample(
const std::string& aName ) {
return wxFileName::FileExists(
path( aName ) ); }
67 if( !haveSample(
"PRJ.PCB" ) )
73 BOOST_CHECK( m_plugin.CanReadBoard(
path(
"PRJ.PCB" ) ) );
81 if( !haveSample(
"PRJ.PCB" ) )
87 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
89 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
"PRJ.PCB" ), board.get(),
nullptr ) );
92 BOOST_CHECK_GT( board->Footprints().size(), 0 );
96 for(
FOOTPRINT* fp : board->Footprints() )
97 pads += fp->Pads().size();
99 BOOST_CHECK_GT( pads, 0 );
100 BOOST_CHECK_GT( board->Tracks().size(), 0 );
109 if( !haveSample(
"PRJ12.PCB" ) )
115 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
117 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
"PRJ12.PCB" ), board.get(),
nullptr ) );
131 BOOST_CHECK_GT( tracks, 0 );
132 BOOST_CHECK_GT( vias, 0 );
133 BOOST_CHECK_GT( board->Footprints().size(), 0 );
137 for(
FOOTPRINT* fp : board->Footprints() )
138 pads += fp->Pads().size();
140 BOOST_CHECK_GT( pads, 0 );
148 const std::vector<std::string> samples = {
"PRJ.PCB",
"PRJ2.PCB",
"PRJ10.PCB",
"PRJ12.PCB" };
152 for(
const std::string&
name : samples )
154 if( !haveSample(
name ) )
159 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
160 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
name ), board.get(),
nullptr ) );
163 size_t items = board->Tracks().size() + board->Footprints().size() + board->Drawings().size();
164 BOOST_CHECK_GT( items, 0 );
General utilities for PCB file IO for QA programs.
Read-only importer for Protel Autotrax (.PCB, "PCB FILE 4") and Easytrax (.PCB, "PCB FILE 5") layout ...
A type-safe container of any type.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
std::string path(const std::string &aName)
AUTOTRAX_IMPORT_FIXTURE()
bool haveSample(const std::string &aName)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(SniffRecognizesPcb)
CanReadBoard must accept a real Autotrax file by sniffing the magic header, not just the (gEDA-shared...
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)