46#include <wx/filename.h>
55 std::string
path(
const std::string& aName )
60 bool haveSample(
const std::string& aName ) {
return wxFileName::FileExists(
path( aName ) ); }
71 if( !haveSample(
"PRJ.PCB" ) )
77 BOOST_CHECK( m_plugin.CanReadBoard(
path(
"PRJ.PCB" ) ) );
85 if( !haveSample(
"PRJ.PCB" ) )
91 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
93 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
"PRJ.PCB" ), board.get(),
nullptr ) );
96 BOOST_CHECK_GT( board->Footprints().size(), 0 );
100 for(
FOOTPRINT* fp : board->Footprints() )
101 pads += fp->Pads().size();
103 BOOST_CHECK_GT( pads, 0 );
104 BOOST_CHECK_GT( board->Tracks().size(), 0 );
113 if( !haveSample(
"PRJ12.PCB" ) )
119 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
121 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
"PRJ12.PCB" ), board.get(),
nullptr ) );
135 BOOST_CHECK_GT( tracks, 0 );
136 BOOST_CHECK_GT( vias, 0 );
137 BOOST_CHECK_GT( board->Footprints().size(), 0 );
141 for(
FOOTPRINT* fp : board->Footprints() )
142 pads += fp->Pads().size();
144 BOOST_CHECK_GT( pads, 0 );
152 const std::vector<std::string> samples = {
"PRJ.PCB",
"PRJ2.PCB",
"PRJ10.PCB",
"PRJ12.PCB" };
156 for(
const std::string&
name : samples )
158 if( !haveSample(
name ) )
163 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
164 BOOST_REQUIRE_NO_THROW( m_plugin.LoadBoard(
path(
name ), board.get(),
nullptr ) );
167 size_t items = board->Tracks().size() + board->Footprints().size() + board->Drawings().size();
168 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)