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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef TEST_DIPTRACE_BENCHMARKS_FIXTURE_H
21#define TEST_DIPTRACE_BENCHMARKS_FIXTURE_H
22
27
31
35#include <pcbnew/drc/drc_rule.h>
36
37#include <reporter.h>
38#include <board.h>
39#include <ki_exception.h>
40#include <footprint.h>
41#include <pad.h>
42#include <pcb_track.h>
43#include <pcb_shape.h>
44#include <zone.h>
45#include <netinfo.h>
46#include <layer_ids.h>
47#include <base_units.h>
49#include <wx/log.h>
50#include <wx/xml/xml.h>
51
52#include <algorithm>
53#include <array>
54#include <cctype>
55#include <cmath>
56#include <cstdint>
57#include <cstdlib>
58#include <filesystem>
59#include <functional>
60#include <map>
61#include <set>
62#include <string>
63#include <unordered_map>
64#include <vector>
65
66
68{
70
72
73 std::string GetTestDataDir() { return KI_TEST::GetPcbnewTestDataDir() + "plugins/diptrace/"; }
74
75 std::unique_ptr<BOARD> LoadBoard( const std::string& aFileName )
76 {
77 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
78 m_plugin.LoadBoard( GetTestDataDir() + aFileName, board.get() );
79 return board;
80 }
81
82 std::unique_ptr<BOARD> LoadBoardFromPath( const std::string& aPath )
83 {
84 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
85 m_plugin.LoadBoard( aPath, board.get() );
86 return board;
87 }
88};
89
90#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)