KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_diptrace_benchmarks_fixture.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, 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#ifndef TEST_DIPTRACE_BENCHMARKS_FIXTURE_H
25#define TEST_DIPTRACE_BENCHMARKS_FIXTURE_H
26
31
35
39#include <pcbnew/drc/drc_rule.h>
40
41#include <reporter.h>
42#include <board.h>
43#include <ki_exception.h>
44#include <footprint.h>
45#include <pad.h>
46#include <pcb_track.h>
47#include <pcb_shape.h>
48#include <zone.h>
49#include <netinfo.h>
50#include <layer_ids.h>
51#include <base_units.h>
53#include <wx/log.h>
54#include <wx/xml/xml.h>
55
56#include <algorithm>
57#include <array>
58#include <cctype>
59#include <cmath>
60#include <cstdint>
61#include <cstdlib>
62#include <filesystem>
63#include <functional>
64#include <map>
65#include <set>
66#include <string>
67#include <unordered_map>
68#include <vector>
69
70
72{
74
76
77 std::string GetTestDataDir() { return KI_TEST::GetPcbnewTestDataDir() + "plugins/diptrace/"; }
78
79 std::unique_ptr<BOARD> LoadBoard( const std::string& aFileName )
80 {
81 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
82 m_plugin.LoadBoard( GetTestDataDir() + aFileName, board.get() );
83 return board;
84 }
85
86 std::unique_ptr<BOARD> LoadBoardFromPath( const std::string& aPath )
87 {
88 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
89 m_plugin.LoadBoard( aPath, board.get() );
90 return board;
91 }
92};
93
94#endif // TEST_DIPTRACE_BENCHMARKS_FIXTURE_H
General utilities for PCB file IO for QA programs.
Parser for DipTrace binary .dip board files.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
Pcbnew PCB_IO for DipTrace binary .dip board files.
std::unique_ptr< BOARD > LoadBoard(const std::string &aFileName)
std::unique_ptr< BOARD > LoadBoardFromPath(const std::string &aPath)