KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eeschema_test_utils.h
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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef QA_EESCHEMA_EESCHEMA_TEST_UTILS__H
21#define QA_EESCHEMA_EESCHEMA_TEST_UTILS__H
22
23#include <memory>
24#include <schematic.h>
26#include <sch_io/sch_io_mgr.h>
27#include <wx/filename.h>
28
29#include <connection_graph.h>
32#include <netlist_reader/netlist_reader.h>
34#include <project.h>
35#include <sch_sheet.h>
36#include <schematic.h>
39
40namespace KI_TEST
41{
46{
47public:
49
51
52protected:
53 virtual void LoadSchematic( const wxFileName& aFn );
54 virtual wxFileName SchematicQAPath( const wxString& aBaseName );
56
57 std::unique_ptr<SCHEMATIC> m_schematic;
60};
61
62
63} // namespace KI_TEST
64
65
66template <typename Exporter>
68{
69public:
70 virtual wxString GetNetlistPath( bool aTest = false );
71 virtual unsigned GetNetlistOptions() { return 0; }
72
73 void WriteNetlist();
74
75 virtual void CompareNetlists() = 0;
76
77 void Cleanup();
78
79 void TestNetlist( const wxString& aBaseName );
80};
81
82#endif // QA_EESCHEMA_EESCHEMA_TEST_UTILS__H
A generic fixture for loading schematics and associated settings for qa tests.
std::unique_ptr< SCHEMATIC > m_schematic
virtual void LoadSchematic(const wxFileName &aFn)
virtual wxFileName SchematicQAPath(const wxString &aBaseName)
void TestNetlist(const wxString &aBaseName)
virtual void CompareNetlists()=0
virtual wxString GetNetlistPath(bool aTest=false)
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition io_mgr.h:33
Definition of file extensions used in Kicad.