KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_eagle_plugin.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2017 CERN
5 * @author Alejandro GarcĂ­a Montoro <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
26
27#include <core/ignore.h>
28#include <kiway.h>
29#include <sch_io/sch_io_mgr.h>
30
31#include "eeschema_test_utils.h"
32
37{
38 IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) );
39 BOOST_CHECK_NE( pi.get(), nullptr );
40}
41
42
46static wxFileName getEagleTestSchematic( const wxString& sch_file )
47{
48 wxFileName fn( KI_TEST::GetEeschemaTestDataDir() );
49 fn.AppendDir( "io" );
50 fn.AppendDir( "eagle" );
51 fn.SetFullName( sch_file );
52
53 return fn;
54}
55
56
61{
62 IO_RELEASER<SCH_IO> 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}
KICAD_PLUGIN_EXPORT SCENEGRAPH * Load(char const *aFileName)
reads a model file and creates a generic display structure
void ignore_unused(const T &)
Definition: ignore.h:24
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition: io_mgr.h:33
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
BOOST_AUTO_TEST_CASE(FindPlugin)
Checks that the SCH_IO manager finds the Eagle plugin.
static wxFileName getEagleTestSchematic(const wxString &sch_file)
Get a schematic file from the test data eagle subdir.