KiCad PCB EDA Suite
test_eagle_plugin.cpp File Reference

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (FindPlugin)
 Checks that the SCH_IO manager finds the Eagle plugin. More...
 
static wxFileName getEagleTestSchematic (const wxString &sch_file)
 Get a schematic file from the test data eagle subdir. More...
 
 BOOST_AUTO_TEST_CASE (Load)
 Check that a file can be loaded. More...
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( FindPlugin  )

Checks that the SCH_IO manager finds the Eagle plugin.

Definition at line 35 of file test_eagle_plugin.cpp.

36 {
37  SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE );
38  BOOST_CHECK_NE( pi, nullptr );
40 }
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io_mgr.h:151
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
Definition: sch_io_mgr.cpp:69

References SCH_IO_MGR::ReleasePlugin().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( Load  )

Check that a file can be loaded.

Definition at line 59 of file test_eagle_plugin.cpp.

60 {
61  SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE );
62 
63  const auto fn = getEagleTestSchematic( "eagle-import-testfile.sch" );
64 
65  BOOST_TEST_MESSAGE( fn.GetFullPath() );
66 
67  (void) pi;
68  // This doesn't work with a null KiWay.
69  // const SCH_SHEET* sheet = pi->Load( fn.GetFullPath(), nullptr );
70  // BOOST_CHECK_NE( nullptr, sheet );
71 
73 }
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io_mgr.h:151
static wxFileName getEagleTestSchematic(const wxString &sch_file)
Get a schematic file from the test data eagle subdir.
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
Definition: sch_io_mgr.cpp:69

References getEagleTestSchematic(), and SCH_IO_MGR::ReleasePlugin().

◆ getEagleTestSchematic()

static wxFileName getEagleTestSchematic ( const wxString &  sch_file)
static

Get a schematic file from the test data eagle subdir.

Definition at line 46 of file test_eagle_plugin.cpp.

47 {
48  wxFileName fn = KI_TEST::GetEeschemaTestDataDir();
49  fn.AppendDir( "eagle_schematics" );
50  fn.SetFullName( sch_file );
51 
52  return fn;
53 }
wxFileName GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.

References KI_TEST::GetEeschemaTestDataDir().

Referenced by BOOST_AUTO_TEST_CASE().