57 std::vector<std::pair<wxString, wxString>> tests = {
58 {
"footprint-with-thermal-pad.cpa",
"footprint-with-thermal-pad.pretty" }
63 for(
const std::pair<wxString, wxString>& libName : tests )
65 wxString cstarLibraryPath = dataPath + libName.first;
66 wxString kicadLibraryPath = dataPath + libName.second;
68 wxArrayString cstarFootprintNames;
69 wxArrayString kicadFootprintNames;
71 cstarPlugin.FootprintEnumerate( cstarFootprintNames, cstarLibraryPath,
true,
nullptr );
72 kicadPlugin.FootprintEnumerate( kicadFootprintNames, kicadLibraryPath,
true,
nullptr );
74 BOOST_CHECK_EQUAL( cstarFootprintNames.GetCount(), kicadFootprintNames.GetCount() );
76 for(
size_t i = 0; i < cstarFootprintNames.GetCount(); i++ )
78 wxString footprintName = cstarFootprintNames[i];
80 BOOST_TEST_CONTEXT( wxString::Format( wxT(
"Import '%s' from '%s'" ), footprintName,
83 FOOTPRINT* eagleFp = cstarPlugin.FootprintLoad( cstarLibraryPath, footprintName,
85 BOOST_CHECK( eagleFp );
88 BOOST_CHECK_EQUAL( footprintName, eagleFp->
GetValue() );
91 kicadPlugin.FootprintLoad( kicadLibraryPath, footprintName,
true,
nullptr );
92 BOOST_CHECK( kicadFp );
General utilities for PCB file IO for QA programs.
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
void CheckFootprint(const FOOTPRINT *expected, const FOOTPRINT *fp)
Helper method to check if two footprints are semantically the same.
PCB_IO_KICAD_SEXPR kicadPlugin
PCB_IO_CADSTAR_ARCHIVE cstarPlugin
BOOST_AUTO_TEST_SUITE_END()