KiCad PCB EDA Suite
test_eagle_plugin.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <ignore.h>
#include <kiway.h>
#include <sch_io_mgr.h>
#include "eeschema_test_utils.h"

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 36 of file test_eagle_plugin.cpp.

37{
38 SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE );
39 BOOST_CHECK_NE( pi, nullptr );
41}
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
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io_mgr.h:153

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 60 of file test_eagle_plugin.cpp.

61{
62 SCH_PLUGIN* pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE );
63
64 const auto fn = getEagleTestSchematic( "eagle-import-testfile.sch" );
65
66 BOOST_TEST_MESSAGE( fn.GetFullPath() );
67
68 ignore_unused( pi );
69 // This doesn't work with a null KiWay.
70 // const SCH_SHEET* sheet = pi->Load( fn.GetFullPath(), nullptr );
71 // BOOST_CHECK_NE( nullptr, sheet );
72
74}
void ignore_unused(const T &)
Definition: ignore.h:24
static wxFileName getEagleTestSchematic(const wxString &sch_file)
Get a schematic file from the test data eagle subdir.

References getEagleTestSchematic(), ignore_unused(), 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 47 of file test_eagle_plugin.cpp.

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

References KI_TEST::GetEeschemaTestDataDir().

Referenced by BOOST_AUTO_TEST_CASE().