Browse Source

Testing the structure

pull/5/merge
Alejandro García Montoro 9 years ago
committed by Maciej Suminski
parent
commit
75b0549f6f
  1. 10
      eeschema/qa/CMakeLists.txt
  2. 23
      eeschema/qa/test_basic.cpp
  3. 4
      eeschema/sch_eagle_plugin.cpp

10
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}
)

23
eeschema/qa/test_basic.cpp

@ -24,21 +24,26 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
#include <sch_eagle_plugin.h>
#include <sch_io_mgr.h>
#include <kiway.h>
#include <data/fixtures_eagle_plugin.h>
// /**
// * 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());
}

4
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;
}

Loading…
Cancel
Save