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#pragma once
21
22#include <memory>
23#include <schematic.h>
25#include <sch_io/sch_io_mgr.h>
26#include <wx/filename.h>
27
32#include <schematic.h>
34
35namespace KI_TEST
36{
41{
42public:
44
46
47protected:
48 virtual void LoadSchematic( const wxFileName& aFn );
49 virtual wxFileName SchematicQAPath( const wxString& aBaseName );
50
52
53 std::unique_ptr<SCHEMATIC> m_schematic;
56};
57
58
59} // namespace KI_TEST
60
61
62template <typename Exporter>
64{
65public:
66 virtual wxString GetNetlistPath( bool aTest = false );
67 virtual unsigned GetNetlistOptions() { return 0; }
68
69 void WriteNetlist();
70
71 virtual void CompareNetlists() = 0;
72
73 void Cleanup();
74
75 void TestNetlist( const wxString& aBaseName );
76};
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
Test utilities for timestamps.