KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_easyedapro_v3_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 The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
24
#include <
qa_utils/wx_utils/unit_test_utils.h
>
25
26
#include <
lib_symbol.h
>
27
#include <
sch_io/sch_io.h
>
28
#include <
sch_io/sch_io_mgr.h
>
29
#include <
sch_pin.h
>
30
31
#include <memory>
32
33
34
static
wxString
getEasyEdaProV3ArchivePath
()
35
{
36
return
wxString::FromUTF8(
37
KI_TEST::GetTestDataRootDir
()
38
+
"pcbnew/plugins/easyedapro/ProProject_LS2K0300Core_2025-11-14.epro2"
);
39
}
40
41
42
static
wxString
getEasyEdaProV3SymbolLibPath
()
43
{
44
return
wxString::FromUTF8(
KI_TEST::GetTestDataRootDir
() +
"eeschema/plugins/easyedapro/LS2K0300_Symbol.elibz2"
);
45
}
46
47
48
static
wxString
getEasyEdaProV3FootprintLibPath
()
49
{
50
return
wxString::FromUTF8(
KI_TEST::GetTestDataRootDir
()
51
+
"pcbnew/plugins/easyedapro/LS2K0300_Footprint_2025-11-14.elibz2"
);
52
}
53
54
55
BOOST_AUTO_TEST_CASE
( EasyEdaProV3FindPlugin )
56
{
57
IO_RELEASER<SCH_IO>
plugin( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EASYEDAPRO_V3 ) );
58
BOOST_CHECK_NE( plugin.get(),
nullptr
);
59
}
60
61
62
BOOST_AUTO_TEST_CASE
( EasyEdaProV3CanReadSchematicFile )
63
{
64
IO_RELEASER<SCH_IO>
plugin( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EASYEDAPRO_V3 ) );
65
BOOST_REQUIRE
( plugin );
66
67
BOOST_CHECK( plugin->CanReadSchematicFile(
getEasyEdaProV3ArchivePath
() ) );
68
}
69
70
71
BOOST_AUTO_TEST_CASE
( EasyEdaProV3GuessPluginType )
72
{
73
BOOST_CHECK_EQUAL
(
74
SCH_IO_MGR::GuessPluginTypeFromSchPath
(
getEasyEdaProV3ArchivePath
() ),
75
SCH_IO_MGR::SCH_EASYEDAPRO_V3 );
76
}
77
78
79
BOOST_AUTO_TEST_CASE
( EasyEdaProV3CanReadSymbolLibrary )
80
{
81
IO_RELEASER<SCH_IO>
plugin( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EASYEDAPRO_V3 ) );
82
BOOST_REQUIRE
( plugin );
83
84
BOOST_CHECK( plugin->CanReadLibrary(
getEasyEdaProV3SymbolLibPath
() ) );
85
BOOST_CHECK( !plugin->CanReadLibrary(
getEasyEdaProV3FootprintLibPath
() ) );
86
}
87
88
89
BOOST_AUTO_TEST_CASE
( EasyEdaProV3EnumeratesAndLoadsSymbolLibrary )
90
{
91
IO_RELEASER<SCH_IO>
plugin( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EASYEDAPRO_V3 ) );
92
BOOST_REQUIRE
( plugin );
93
94
wxArrayString symbolNames;
95
BOOST_REQUIRE_NO_THROW( plugin->EnumerateSymbolLib( symbolNames,
getEasyEdaProV3SymbolLibPath
() ) );
96
97
BOOST_REQUIRE_EQUAL( symbolNames.GetCount(), 1 );
98
BOOST_CHECK_EQUAL
( symbolNames[0], wxString( wxS(
"LS2K0300"
) ) );
99
100
std::unique_ptr<LIB_SYMBOL> symbol( plugin->LoadSymbol(
getEasyEdaProV3SymbolLibPath
(), wxS(
"LS2K0300"
) ) );
101
102
BOOST_REQUIRE
( symbol );
103
BOOST_CHECK_EQUAL
( symbol->GetName(), wxString( wxS(
"LS2K0300"
) ) );
104
BOOST_CHECK_EQUAL
( symbol->GetUnitCount(), 5 );
105
BOOST_CHECK( symbol->GetPins().size() > 200 );
106
}
SCH_IO_MGR::GuessPluginTypeFromSchPath
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath, int aCtl=0)
Return a plugin type given a schematic using the file extension of aSchematicPath.
Definition
sch_io_mgr.cpp:215
IO_RELEASER
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition
io_mgr.h:33
lib_symbol.h
KI_TEST::GetTestDataRootDir
std::string GetTestDataRootDir()
Definition
unit_test_utils.cpp:64
sch_io.h
sch_io_mgr.h
sch_pin.h
getEasyEdaProV3SymbolLibPath
static wxString getEasyEdaProV3SymbolLibPath()
Definition
test_easyedapro_v3_plugin.cpp:42
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(EasyEdaProV3FindPlugin)
Definition
test_easyedapro_v3_plugin.cpp:55
getEasyEdaProV3ArchivePath
static wxString getEasyEdaProV3ArchivePath()
Definition
test_easyedapro_v3_plugin.cpp:34
getEasyEdaProV3FootprintLibPath
static wxString getEasyEdaProV3FootprintLibPath()
Definition
test_easyedapro_v3_plugin.cpp:48
BOOST_REQUIRE
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(result, "25.4")
unit_test_utils.h
src
qa
tests
eeschema
test_easyedapro_v3_plugin.cpp
Generated on Sat Jul 25 2026 00:06:04 for KiCad PCB EDA Suite by
1.13.2