diff --git a/eeschema/qa/CMakeLists.txt b/eeschema/qa/CMakeLists.txt index 4c5b8675fd..f67bd69a66 100644 --- a/eeschema/qa/CMakeLists.txt +++ b/eeschema/qa/CMakeLists.txt @@ -34,11 +34,11 @@ add_executable( qa_eagle_plugin test_basic.cpp ) -add_dependencies( qa_eagle_plugin eeschema ) +add_dependencies( qa_eagle_plugin common eeschema_kiface ) target_link_libraries( qa_eagle_plugin - eeschema - eeschema_kiface - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} - ${wxWidgets_LIBRARIES} + common + eeschema_kiface + ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} + ${wxWidgets_LIBRARIES} ) diff --git a/eeschema/qa/test_basic.cpp b/eeschema/qa/test_basic.cpp index 315e5b4ca4..7201d35253 100644 --- a/eeschema/qa/test_basic.cpp +++ b/eeschema/qa/test_basic.cpp @@ -24,21 +24,26 @@ #include #include -#include +#include +#include #include -// /** -// * Declares the IteratorFixture as the boost test suite fixture. -// */ -// BOOST_FIXTURE_TEST_SUITE( SegmentReference, CommonTestData ) +/** + * Checks that the SCH_IO manager finds the Eagle plugin + */ +BOOST_AUTO_TEST_CASE( FindPlugin ) +{ + BOOST_CHECK( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) != NULL ); +} /** - * Checks the XML tree load + * */ BOOST_AUTO_TEST_CASE( Load ) { - SCH_EAGLE_PLUGIN plugin; - // - // plugin.Load( "data/eagle_schematics/empty.sch", NULL ); + SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ); + + pi->Load("/home/alejandro/Proyectos/kicad/kicad-alejandro/eeschema/qa/data/eagle_schematics", + &Kiway()); } diff --git a/eeschema/sch_eagle_plugin.cpp b/eeschema/sch_eagle_plugin.cpp index cb29143695..1898df4226 100644 --- a/eeschema/sch_eagle_plugin.cpp +++ b/eeschema/sch_eagle_plugin.cpp @@ -68,8 +68,8 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway, wxFileName fn = aFileName; - // if( !m_xmlTree.Load( fn.GetFullPath() ) ) - // THROW_IO_ERROR( wxString::Format( _( "Unable to read file '%s'" ), fn.GetFullPath() ) ); + if( !m_xmlTree.Load( fn.GetFullPath() ) ) + THROW_IO_ERROR( wxString::Format( _( "Unable to read file '%s'" ), fn.GetFullPath() ) ); return sheet; }